-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjest.config.js
46 lines (46 loc) · 1.17 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export default {
projects: [
{
preset: 'ts-jest/presets/default-esm',
globals: {
RELEASE: 'test',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
setupFilesAfterEnv: ['./test/jest.setup-file.ts'],
// it was harder than expected to setup
// more documentation on https://miniflare.dev/testing/jest
testEnvironment: 'miniflare',
// Configuration is automatically loaded from `.env`, `package.json` and
// `wrangler.toml` files by default, but you can pass any additional Miniflare
// API options here:
testEnvironmentOptions: {
bindings: {
LOGGING_SHIM_TOKEN: '',
WSHIM_ENDPOINT: 'https://example.com',
VERSION_METADATA: '',
},
wranglerConfigEnv: 'production',
},
testMatch: ['<rootDir>/**/*.test.ts'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'test/tsconfig.json',
useESM: true,
},
],
},
},
{
runner: 'jest-runner-eslint',
displayName: 'lint',
testMatch: ['<rootDir>/src/**/*.ts', '<rootDir>/__tests__/**/*.ts'],
},
],
collectCoverage: true,
coverageReporters: ['json', 'html', 'lcov', 'text'],
};