1.6.0 • Published 1 year ago

jira-eslint-custom-bdd v1.6.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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

Ready to run

1.6.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago