Package Exports
- @oriflame/config-jest
- @oriflame/config-jest/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@oriflame/config-jest) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Jest Config
Factory functions for creating preset Jest configurations. Primarily used in union with the Lumos CLI.
Extending config
Update package.json:
{
"lumos": {
"jest": {
"setupFilesAfterEnv": ["@testing-library/jest-dom/extend-expect"]
}
}
}Create file in configs folder:
configs/eslint.js
module.exports = {
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
};Settings
Main settings
export interface JestOptions {
graphql?: boolean;
react?: boolean;
node?: boolean;
srcFolder: string;
testsFolder: string;
threshold?: number;
workspaces?: string[];
testResultFileName?: string;
}Default values
{
graphql = false,
react = false,
node = false,
srcFolder,
testsFolder,
threshold = 40,
workspaces = [],
testResultFileName = 'TEST-RESULTS.xml',
};Settings
- graphql
- Enables support for graphQl
- react
- Enables support for react
- node
- Changes from jsdom to node
- srcFolder
- Path to source files
- testsFolder
- Path to test files
- threshold
- Code coverage percentage
- workspaces
- Autogenerated workspaces
- testResultFileName
- Test result file name used in CI
CLI Options
--coverage- Enable code coverage output
Example:
lumos jest --coverage