-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.test.js
More file actions
32 lines (24 loc) · 875 Bytes
/
jest.config.test.js
File metadata and controls
32 lines (24 loc) · 875 Bytes
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
const config = require('./jest.config.js');
// packagejwt/jest.config.test.js
describe('Jest Configuration', () => {
test('should have ts-jest preset', () => {
expect(config.preset).toBe('ts-jest');
});
test('should have node test environment', () => {
expect(config.testEnvironment).toBe('node');
});
test('should have correct roots', () => {
expect(config.roots).toContain('<rootDir>/src/__tests__');
});
test('should have correct module file extensions', () => {
expect(config.moduleFileExtensions).toEqual(expect.arrayContaining(['ts', 'js']));
});
test('should have correct transform configuration', () => {
expect(config.transform).toEqual({
'^.+\\.ts$': 'ts-jest',
});
});
test('should have correct test regex', () => {
expect(config.testRegex).toBe('(/__tests__/.*|(\\.|/)(test|spec))\\.ts$');
});
});