Conversation
| const packageJSON = require('./package.json'); | ||
|
|
||
| process.env.TZ = 'UTC'; | ||
|
|
There was a problem hiding this comment.
this is useful to avoid dealing with dates changing when running under CI systems.
| transform: { | ||
| '\\.[jt]sx?$': 'babel-jest', | ||
| }, | ||
| moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], |
There was a problem hiding this comment.
I've left tsx? there because it helps to my next step of moving everything to TS
| moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
| testURL: 'http://localhost', | ||
| transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'], | ||
| testMatch: ['**/*.(spec|test).js'], |
There was a problem hiding this comment.
I've used spec as a postfix on the files because IMO is easy to filter tests from other files without looking at the path. Also helps when there's a need for adding other files (ex: helpers) to the test directory without having to filter those in the configuration.
| "watch": "babel scripts/watch.js | node", | ||
| "test": "npm run lint && npm run check && npm run test:only", | ||
| "test:only": "mocha $npm_package_options_mocha", | ||
| "test:only": "jest", |
There was a problem hiding this comment.
ideally, I would like to name it test but to avoid pilling up too many changes in 1 PR. I've decided to leave if backward compatible.
|
looks fine to me, thanks for this! |
Description
This PR contains all the changes to make tests run with Jest.
I've removed mocha and chai as well.
Considerations
If this PR is merged we will not need to merge closes #189 🎉