eslint-config-canonical
eslint-config-canonical copied to clipboard
jest doc blocks clash with jsdoc/check-tag-names
Jest test environments are now recommended to be set per-file to improve performance by adding a @jest-environment docblock at the top of the file:
/**
* @jest-environment jsdom
*/
https://jestjs.io/docs/configuration#testenvironment-string
However, this is clashing with rule Check Tag Names https://github.com/gajus/eslint-plugin-jsdoc/blob/master/.README/rules/check-tag-names.md
My suggestion:
For config canonical/jest, either disable the check-tag-names rule or modify its options so it classifies docblocks written as @jest-environment ** as valid
Is it only jest-environment tag?
Is it only
jest-environmenttag?
@jest-environment and @jest-environment-options
/**
* @jest-environment jsdom
* @jest-environment-options {"url": "https://jestjs.io/"}
*/
test('use jsdom and set the URL in this test file', () => {
expect(window.location.href).toBe('https://jestjs.io/');
});