-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.ts
38 lines (34 loc) · 1.18 KB
/
jest.config.ts
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
/**
* This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course.
* © Copyright Utrecht University (Department of Information and Computing Sciences)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { Config } from 'jest';
import { pathsToModuleNameMapper } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const config: Config = {
//ModuleFileExtensions is a different order than the default options, to improve performance
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'mjs',
'cjs',
'json',
'node',
],
// All our .ts files are ESM (Not CommonJS), thus they should be treated as such
extensionsToTreatAsEsm: ['.ts'],
// We need to disable transform since we're using ESM (Not CommonJS)
transform: {},
// We use ts-jest to allow for typescript compatibility.
preset: 'ts-jest',
moduleDirectories: ['node_modules', '<rootDir>'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
};
export default config;