-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathjest.config.js
More file actions
32 lines (32 loc) · 1.62 KB
/
Copy pathjest.config.js
File metadata and controls
32 lines (32 loc) · 1.62 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
module.exports = {
// NotePlan globals before test files load (NPdateTime getRelativeDates at import time needs DataStore)
setupFiles: ['<rootDir>/jest.noteplan-globals.js'],
// A map from regular expressions to module names that allow to stub out resources with a single module
moduleNameMapper: {
'^@helpers/(.*)$': '<rootDir>/helpers/$1',
'^@mocks/(.*)$': '<rootDir>/__mocks__/$1',
'^@plugins/(.*)$': '<rootDir>/$1',
'^@templating/(.*)$': '<rootDir>/np.Templating/lib/$1',
'^@templatingModules/(.*)$': '<rootDir>/np.Templating/lib/support/modules/$1',
'^NPTemplating/(.*)$': '<rootDir>/np.Templating/lib/NPTemplating',
'^TemplatingEngine/(.*)$': '<rootDir>/np.Templating/lib/TemplatingEngine',
'^NPGlobals/(.*)$': '<rootDir>/np.Globals/lib/NPGlobals',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^json-edit-react$': '<rootDir>/node_modules/json-edit-react/build/index.cjs.js',
},
testPathIgnorePatterns: [
'<rootDir>/src/templates/np.plugin.starter',
'<rootDir>/.history/',
// Hits a third-party endpoint we don't control; too flaky for CI but useful to run locally.
...(process.env.CI ? ['<rootDir>/np.Templating/__tests__/web-api-tests.test.js'] : []),
],
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.[tj]sx?$': 'babel-jest', // Handle .js, .jsx, .ts, .tsx files
'^.+\\.mjs$': 'babel-jest', // Use babel-jest for .mjs files as well
},
transformIgnorePatterns: [
'/node_modules/(?!(node-notifier|uuid|lodash-es|json-edit-react)/)', // Ensure these modules are transformed
],
}