- Install these packages:
yarn install --dev @babel/core @babel/preset-env jest babel-jest
- Add
babel.config.js (exactly babel.config.js, not .babelrc, not .babelrc.json etc):
module.exports = {
presets: ["@babel/preset-env"],
};
- Add
jest.config.js:
module.exports = {
testEnvironment: "node",
testRegex: "tests/.*\\.res\\.js$", // optional, defines custom tests location
transformIgnorePatterns: [
"/node_modules/(?!rescript|ALL-RESCRIPT-DEPS|THAT-APPEAR-IN-TESTS).+\\.res\\.js$",
]
};
- Run
jest and pray