@anansi/jest-preset v0.11.8
🕷 Anansi Jest Preset
Testing should just work
Usage
module.exports = {
preset: "@anansi/jest-preset"
}
See @anansi/webpack-config for full list of module formats supported.
Motivation
Anansi's webpack automatically makes media files, svgs, scss/css modules, webworkers and TypeScript or babel work automatically. Using this preset enables all those module types to be handled in exactly as you'd expect with the webpack config.
ENV customization
Jest doesn't give much flexibility with regard to presets, so we provide some environmental variables to do customizations that impact multiple aspects of the configuration. However, this can also be done in a javascript jest config like so:
process.env.ANANSI_JEST_BABELCONFIG = 'babel.config.js';
process.env.ANANSI_JEST_TSCONFIG = 'tsconfig.test.json';
module.exports = {
preset: '@anansi/jest-preset',
};
ANANSI_JEST_TSCONFIG = 'tsconfig.json'
It might be useful to have a specific tsconfig for tests that inherits from the base config. Use this variable to have jest pickup that file instead.
ANANSI_JEST_BABELCONFIG = true
By default jest will automatically search for the appropriate babel configuration (with the value of true
).
In case this doesn't work you can specify a string for the babel configuration.
Using 'babel.config.js' will automatically invoke the rootMode: 'upward'
algorithm.
4 months ago
7 months ago
7 months ago
6 months ago
6 months ago
5 months ago
5 months ago
4 months ago
8 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago