Skip to content

Latest commit

 

History

History
 
 

plugin-jest

@putout/plugin-jest NPM version

Jest is a delightful JavaScript Testing Framework with a focus on simplicity.

(c) jestjs.io

🐊Putout plugin helps to migrate to latest Jest API.

Install

npm i @putout/plugin-jest -D

Rules

{
    "rules": {
        "jest": "on"
    }
}

❌ Example of incorrect code

jest.addMatchers({
    fail: (a, b, c) => {
        return {
            pass: false,
        };
    },
});

jest.resetModuleRegistry();
jest.runTimersToTime(1000);

✅ Example of correct code

expect.extend({
    fail: (a, b, c) => {
        return {
            pass: false,
        };
    },
});

jest.resetModules();
jest.advanceTimersByTime(1000);

License

MIT