-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathjest.config.js
More file actions
42 lines (41 loc) · 1.52 KB
/
jest.config.js
File metadata and controls
42 lines (41 loc) · 1.52 KB
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
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')
module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(jsdom/lib/jsdom/browser/resources/resource-loader))'
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': path.join(__dirname, 'jest-babel-transform.js')
},
setupFiles: [path.join(__dirname, 'setup-jest.js')],
cacheDirectory: './node_modules/.cache',
clearMocks: true,
collectCoverage: true,
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'],
moduleNameMapper: {
'^.+\\.svg$': path.join(__dirname, '__mocks__', 'emptyStringMock.js'),
'^@h4ad/serverless-adapter/lib/(.*)$':
'<rootDir>/node_modules/@h4ad/serverless-adapter/lib/$1/index.cjs'
},
testPathIgnorePatterns: [
'/dist/',
'/temp/',
'/generator-assets/',
'/node_modules/',
'/vendor/'
],
testEnvironment: 'jest-environment-jsdom-global',
testEnvironmentOptions: {
resources: 'usable',
// Prevent jest-environment-jsdom from using 'browser' export conditions (Jest 29+).
// Without this, packages like uuid and nanoid resolve to ESM browser builds
// that Jest cannot parse in a CJS context.
customExportConditions: ['node', 'node-addons']
}
}