I have skipped Playwright node tests but they are not being reported as violations when I run linting with eslint .
.
I am using the eslint-plug-jest
package that I’ve used before in other projects
The rule I use is 'jest/no-disabled-tests'
My tests are using the format test.skip
I don’t get an error, just no violations reported
My tests are using the test.skip(...)
format
This can be fixed by switching to the playwright specific plugin for Jest linting.
First (optional) remove the non functioning eslint jest package.
I tend to remove a package I’m not using. Not sure if I will bring it back later for other purposes.
npm uninstll eslint-plugin-jest
Then install the playwright specific package:
npm install eslint-plugin-playwright
Then change the usage of any rules to the playwright format.
For example skipped tests are detected with the rule playwright-no-skipped-test
instead of ‘jest/no-disabled-tests`, i.e. playwright uses “skipped” instead of “disabled”.
Also notice that it is ...no-skipped-test
and not ...no-skipped-tests
, i.e. singular and not plural like the previous jest rule. Easy to miss that detail.
Final Note: This also requires node version 18+.
With previous versions of Node you’ll get errors about invalid eslint config format.