Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest doc blocks clash with jsdoc/check-tag-names #49

Open
lucasrmendonca opened this issue Jun 25, 2022 · 2 comments
Open

jest doc blocks clash with jsdoc/check-tag-names #49

lucasrmendonca opened this issue Jun 25, 2022 · 2 comments

Comments

@lucasrmendonca
Copy link
Contributor

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

@gajus
Copy link
Owner

gajus commented Jan 16, 2023

Is it only jest-environment tag?

@lucasrmendonca
Copy link
Contributor Author

lucasrmendonca commented Feb 8, 2023

Is it only jest-environment tag?

@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/');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants