forked from sugarlabs/musicblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
29 lines (23 loc) · 889 Bytes
/
jest.config.js
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
module.exports = {
// Use jsdom to simulate a browser environment
testEnvironment: 'jest-environment-jsdom',
// Specify where Jest should look for test files
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
// Transform JavaScript files using Babel (if needed)
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
// Clear mocks between tests for isolation
clearMocks: true,
// Collect coverage information and specify the directory
collectCoverage: true,
coverageDirectory: 'coverage',
// Specify file extensions Jest will process
moduleFileExtensions: ['js', 'jsx', 'json', 'node'],
// Define any global variables for the tests
globals: {
'window': {},
},
// Set up files to run before tests (e.g., polyfills, setup scripts)
setupFiles: ['./jest.setup.js'], // Optional, if you have a setup file
};