jira-eslint-custom-bdd
v1.6.0
Published
This module uses mocha and custom http request to update/link/create jira tickets given the required credentials and configuration
Downloads
2
Readme
Requirements
- Node Version: v17.9.0
Setup
- Go to package path: node_modules/jira-eslint-custom-bdd
- Run 'npm install' on package's folder
- Go back to project's root
- Install 'eslint' & 'mocha' on project's root
npm install eslint
npm install mocha
- 'Add' following scripts to your package.json on project's root:
"lint-fix": "eslint --ext .js --rulesdir node_modules/jira-eslint-custom-bdd --ignore-path .gitignore --ignore-path .eslintignore --max-warnings 0 --fix .",
"jira-mocha-report": "mocha -R node_modules/jira-eslint-custom-bdd/jira-update-report.js 'src/PATH/TOTEST.spec.js' --no-exit"
- Create launch.json file with the following configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "eslint",
"request": "launch",
"runtimeArgs": [
"run-script",
"lint-fix"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"runtimeVersion": "17.9.0",
"env": {
"JiraPassword": "required",
"jiraHost": "required",
"jiraUsername": "required",
"client_id": "required",
"client_secret": "required",
"testExecutionKey": "required",
"storyBoardIDCreation": "required",
"xrayBoardIDCreation": "required",
"xrayBoardID": "required",
"storyIssueType": "required",
"xrayIssueType": "required",
"linkTypeID": "required",
"storyRegex": "//HEREYOURBOARD-(\\d+)://", // (EXAMPLE: "//DS-(\\d+)://")
"xrayRegex": "//HEREYOURBOARD-(\\d+)://", // (EXAMPLE: "//DSCA-(\\d+)://")
}
},
{
"name": "jira-mocha-report",
"request": "launch",
"runtimeArgs": [
"run-script",
"jira-mocha-report"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"runtimeVersion": "17.9.0",
"env": {
"JiraPassword": "required",
"jiraHost": "required",
"jiraUsername": "required",
"client_id": "required",
"client_secret": "required",
"testExecutionKey": "required",
"storyBoardIDCreation": "required",
"xrayBoardIDCreation": "required",
"xrayBoardID": "required",
"storyIssueType": "required",
"xrayIssueType": "required",
"linkTypeID": "required",
"storyRegex": "//HEREYOURBOARD-(\\d+)://", //(EXAMPLE: "//DS-(\\d+)://"),
"xrayRegex": "//HEREYOURBOARD-(\\d+)://", //(EXAMPLE: "//DSCA-(\\d+)://")
}
}
]
}
- Create a .eslintrc.json with the following structure:
{
"extends": ["eslint:recommended"],
"parserOptions": { "ecmaVersion": 2018 } ,
"env": {
"es6": true,
"mocha": true,
"node": true
},
"overrides": [
{
"files": ["src/**/*.js"],
"rules": {
"mockaTest": "error"
}
}
]
}
- Create a .eslintignore with the execptions, exceptions will be the unit test files you want to include whenever running the eslint custom rule. exceptions are marked with '!'
**/*.js
!**/src/PATH/TOTEST.spec.js