-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
22 lines (18 loc) · 863 Bytes
/
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
// Copyright (C) 2022 Varghese Mathew (Matt)
// Distributed under GNU GENERAL PUBLIC LICENSE Version 3
// See ~/license.txt for details
// Blog: https://mattvarghese-cs.blogspot.com/2022/01/minimal-typescript-react-project.html
// GitHub: https://github.com/mattvarghese/minimal-typescript-react-template
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
verbose: true,
preset: "ts-jest",
testEnvironment: "jsdom",
moduleNameMapper: {
// resource files will get replaced by a constant string when testing
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/tests/__mocks__/fileMock.ts",
// style imports will get replaced by an empty object when testing
"\\.(scss|sass|css)$": "<rootDir>/src/tests/__mocks__/styleMock.ts"
}
};
export default config;