cal.pub0.org/jest.config.ts

75 lines
2.4 KiB
TypeScript
Raw Normal View History

2022-03-23 21:32:46 +00:00
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
const config = {
2022-03-23 21:32:46 +00:00
clearMocks: true,
2022-03-25 05:54:57 +00:00
coverageDirectory: "./coverage",
collectCoverage: true,
2022-03-23 21:32:46 +00:00
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],
// Indicates which provider should be used to instrument code for coverage
// coverageProvider: "babel",
// A list of reporter names that Jest uses when writing coverage reports
2022-03-25 05:54:57 +00:00
coverageReporters: [
"json",
"text",
"lcov",
"clover"
],
2022-03-23 21:32:46 +00:00
// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
// A path to a custom dependency extractor
// dependencyExtractor: undefined,
// Make calling deprecated APIs throw helpful error messages
2022-03-25 05:54:57 +00:00
errorOnDeprecated: true,
2022-03-23 21:32:46 +00:00
// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
// A set of global variables that need to be available in all test environments
// globals: {},
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
2022-03-25 05:54:57 +00:00
maxWorkers: "50%",
2022-03-23 21:32:46 +00:00
moduleNameMapper: {
"^@lib/(.*)$": "<rootDir>/lib/$1",
2022-03-25 05:54:57 +00:00
"^@api/(.*)$": "<rootDir>/pages/api/$1",
},
2022-03-23 21:32:46 +00:00
// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
// The number of seconds after which a test is considered as slow and reported as such in the results.
slowTestThreshold: 1,
2022-03-23 21:32:46 +00:00
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
// The test environment that will be used for testing
testEnvironment: "node",
};
export default config;