Skip to content

Instantly share code, notes, and snippets.

@alex35mil
Last active February 16, 2024 06:34
Show Gist options
  • Save alex35mil/d6a37187fd9a673e4b2fe21f8f2f2e0e to your computer and use it in GitHub Desktop.
Save alex35mil/d6a37187fd9a673e4b2fe21f8f2f2e0e to your computer and use it in GitHub Desktop.
  1. Install these packages:
yarn install --dev @babel/core @babel/preset-env jest babel-jest
  1. Add babel.config.js (exactly babel.config.js, not .babelrc, not .babelrc.json etc):
module.exports = {
  presets: ["@babel/preset-env"],
};
  1. 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$",
  ]
};
  1. Run jest and pray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment