forked from 2factorauth/twofactorauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
67 lines (54 loc) · 1.81 KB
/
jest.config.js
File metadata and controls
67 lines (54 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Jest Configuration for 2FA Directory Project
*
* This configuration file sets up Jest testing framework for the project.
* It includes settings for test coverage, test environment, and test patterns.
*
* @see https://jestjs.io/docs/configuration
*/
module.exports = {
// The test environment that will be used for testing
testEnvironment: 'node',
// The glob patterns Jest uses to detect test files
testMatch: [
'**/tests/**/*.test.js',
'**/tests/**/*.spec.js',
],
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
'/node_modules/',
'/api/',
'/img/',
],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
'text',
'lcov',
'html',
],
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// Automatically clear mock calls and instances between every test
clearMocks: true,
// The maximum amount of workers used to run your tests
maxWorkers: '50%',
// A map from regular expressions to module names that allow to stub out resources
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'^@tests/(.*)$': '<rootDir>/tests/$1',
'^@scripts/(.*)$': '<rootDir>/scripts/$1',
},
// Indicates whether each individual test should be reported during the run
verbose: true,
// An array of regexp pattern strings that are matched against all test paths before executing the test
testPathIgnorePatterns: [
'/node_modules/',
'/api/',
],
// The number of seconds after which a test is considered as slow and reported as such
slowTestThreshold: 10,
// Timeout for tests in milliseconds
testTimeout: 30000,
};