Skip to content

Commit c65df31

Browse files
author
Jeffrey Na
committed
jest.config.ts
1 parent 4a3ae1d commit c65df31

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

jest.config.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { Config } from '@jest/types';
2+
3+
// module.exports = {
4+
// verbose: true,
5+
// setupFilesAfterEnv: ['./jest_setup/windowMock.js'],
6+
// testEnvironment: "jsdom",
7+
// preset: 'ts-jest/presets/js-with-ts',
8+
// moduleNameMapper: {
9+
// '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
10+
// '<rootDir>/jest_setup/fileMock.js',
11+
// '\\.(css|less|scss)$': '<rootDir>/jest_setup/styleMock.js',
12+
// },
13+
// collectCoverage: true,
14+
// // types: ["jest","node"],
15+
// };
16+
17+
// Convert to TypeScript
18+
// Note: Configuring Jest to TypeScript following the docs seemed incorrect?
19+
// @jest/types is an npm package to use to create a typed Jest config
20+
21+
const config: Config.InitialOptions = {
22+
verbose: true,
23+
setupFilesAfterEnv: ['./jest_setup/windowMock.js'],
24+
testEnvironment: "jsdom",
25+
preset: 'ts-jest/presets/js-with-ts',
26+
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
27+
moduleNameMapper: {
28+
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
29+
'<rootDir>/jest_setup/fileMock.js',
30+
'\\.(css|less|scss)$': '<rootDir>/jest_setup/styleMock.js',
31+
},
32+
collectCoverage: true,
33+
};
34+
35+
export default config;

0 commit comments

Comments
 (0)