justin
1
- 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/.*\\.bs\\.js$", // optional, defines custom tests location
transformIgnorePatterns: [
"/node_modules/(?!bs-platform|ALL-BS-DEPS-THAT-APPEAR-IN-TESTS).+\\.bs\\.js$",
]
};
- Run
jest
and pray