Skip to content

Instantly share code, notes, and snippets.

@vladanyes
Last active August 23, 2018 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladanyes/e26ab6dd881253130f78aa2e1c36cbd0 to your computer and use it in GitHub Desktop.
Save vladanyes/e26ab6dd881253130f78aa2e1c36cbd0 to your computer and use it in GitHub Desktop.
jest.conf.js
const {defaults} = require('jest-config');
module.exports = {
// ...
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
setupFiles: ["./js/all-browsers/urls.js", "./tests/jest.jquery.js"],
rootDir: '../',
// ...
};
///
https://jestjs.io/docs/en/configuration.html#options
https://www.jetbrains.com/help/phpstorm/running-unit-tests-on-jest.html
///
files needed to be tested got to be with .test.js. name.
files needed to load everytime one test loads should be declared in setupFiles.It may be some global variables.
All paths writing relative to jest.conf.js!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment