Jest

Install the jest-rut package as a dev dependency.

yarn add --dev jest-rut

Once installed, add jest-rut to setupFilesAfterEnv in your jest.config.js file.

jest.config.js
module.exports = {
setupFilesAfterEnv: ['jest-rut'],
};

This will automatically register the snapshot serializer and all matchers. No need to import within your test files.

Matchers#

View the matchers documentation for a full list of available matchers.