To get started contributing to Gherklin, you can install the dependencies and run the tests.
npm install
npm test
Rules are located in the rules directory.
Every rule must have 2 named exports:
schema
: This is the schema the rule followsrun
: This is the main entrypoint for the rule
The run
function accepts 2 - 3 arguments, with fileName
being optional:
rule: Rule
: The rule being evaluateddocument: GherkinDocument
: The Gherkin document being validatedfileName: string
: The name of the file being validated
Rules can be sync
or async
.
Tests are written using Mocha, with Sinon for some mocking.
Each new rule must have acceptance tests.
Gherklin uses ESLint and Prettier for code formatting. It may be useful to set up your IDE to automatically format on save.
You can also run the following if that is not an option:
npm run eslint:fix
npm run prettier:fix
Please be as descriptive as possible in your PR description, mentioning any issue(s) that are resolved by your PR.