ESLint
Install the eslint-plugin-rut
package as a dev dependency.
- Yarn
- NPM
Once installed, add the recommended config to your .eslintrc.js
file. By default this will target
all test files using ESLint overrides in the format of *.test.(ts|js)x?
.
.eslintrc.js
If you prefer to manage the targets yourself, something like the following will suffice.
.eslintrc.js
#
Rulesconsistent-event-type
#
Verify and enforce the correct event types are used when mocking or dispatching events.
no-act
#
Disallow usage of React's act()
within tests. This functionality is provided by Rut and shouldn't
be necessary.
no-internals
#
Disallow import and usage of Rut's internal APIs. Accessing these directly is a code smell.
require-render-generics
#
Require TypeScript generics for render()
and renderAndWait()
functions.
Does not apply to host (DOM) elements.