-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathjest.config.mjs
More file actions
55 lines (51 loc) · 1.57 KB
/
jest.config.mjs
File metadata and controls
55 lines (51 loc) · 1.57 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
/**
* This next version of JSON Schema Form ("V2")
* must be tested against 2 sets ("root") of tests.
* Note that "rootDir" is the path to this next version.
*
* @type {import('jest').Config['roots']}
*/
const roots = [
// 1. The existing tests from the previous version ("V1")
// TODO: Uncomment this once we have V1 features implemented
// '<rootDir>/../src/tests',
// 2. The new tests for this version
'<rootDir>/test',
]
/**
* Module aliases to use the same test with different source versions.
* To learn more, see "roots" above.
*
* This is only needed to use V1 tests for V2 source.
* as V2 tests are used to test V2 source only.
*
* @type {import('jest').Config['moduleNameMapper']}
*/
const moduleNameMapper = {
// We use kebab-case in V2
'^@/createHeadlessForm$': '<rootDir>/src/form',
'^@/utils$': '<rootDir>/src/utils',
// Avoid catch all aliases such as "^@/(.*)$".
// Aliases should be added as needed.
// If there are many, we will have a compat barrel file.
}
/**
* Some tests are invalid for V2 testing.
* For example:
* - Buggy behaviours in V1 that are already fixed (and tested) in V2
* - Deprecated or removed APIs
*
* @type {import('jest').Config['testPathIgnorePatterns']}
*/
const testPathIgnorePatterns = [
// Nothing yet
]
/** @type {import('jest').Config} */
const config = {
roots,
moduleNameMapper,
testPathIgnorePatterns,
reporters: ['default', '<rootDir>/test/json-schema-test-suite/json-schema-test-suite-tracker.js'],
transformIgnorePatterns: ['<rootDir>/node_modules/json-schema-typed/'],
}
export default config