@nlabs/lex 1.54.2 → 1.54.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +4 -4
- package/README.md +25 -25
- package/__mocks__/LexConfig.js +9 -9
- package/__mocks__/boxen.js +1 -1
- package/__mocks__/build.js +6 -6
- package/__mocks__/compare-versions.js +1 -1
- package/__mocks__/compile.js +2 -2
- package/__mocks__/execa.js +2 -2
- package/__mocks__/latest-version.js +1 -1
- package/__mocks__/ora.js +13 -13
- package/__mocks__/versions.js +4 -4
- package/config.json +2 -2
- package/examples/lex.config.js +4 -4
- package/lex.config.js +4 -4
- package/lib/LexConfig.d.ts +2 -9
- package/lib/LexConfig.js +2 -2
- package/lib/commands/ai/ai.js +2 -2
- package/lib/commands/config/config.js +14 -8
- package/lib/commands/migrate/migrate.js +2 -2
- package/lib/commands/test/test.d.ts +2 -0
- package/lib/commands/test/test.js +130 -117
- package/lib/commands/versions/versions.d.ts +1 -1
- package/lib/commands/versions/versions.js +3 -3
- package/lib/lex.js +2 -2
- package/lib/test-react/index.d.ts +1 -1
- package/lib/test-react/index.js +2 -2
- package/lib/types.d.ts +1 -1
- package/lib/types.js +1 -1
- package/lib/utils/app.js +2 -2
- package/lib/vitest.d.js +3 -0
- package/package.json +42 -42
- package/resolver.cjs +11 -9
- package/tsconfig/reactNative.json +3 -2
- package/tsconfig.build.json +3 -3
- package/tsconfig.json +4 -3
- package/tsconfig.lint.json +3 -2
- package/tsconfig.template.json +3 -2
- package/tsconfig.test.json +4 -3
- package/vitest.config.d.mts +2 -0
- package/vitest.config.mjs +61 -0
- package/vitest.config.template.cjs +66 -0
- package/vitest.setup.template.js +19 -0
- package/jest.config.d.mts +0 -50
- package/jest.config.mjs +0 -72
- package/jest.config.template.cjs +0 -71
- package/jest.setup.template.js +0 -18
package/resolver.cjs
CHANGED
|
@@ -15,9 +15,9 @@ module.exports = (value, options) => {
|
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const isSequencer = fileName.startsWith('
|
|
18
|
+
const isSequencer = fileName.startsWith('vitest-sequencer-');
|
|
19
19
|
if(isSequencer) {
|
|
20
|
-
fileName = fileName.replace('
|
|
20
|
+
fileName = fileName.replace('vitest-sequencer-', '');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const {basedir, extensions = ['.js', '.ts', '.tsx', '.cjs']} = options;
|
|
@@ -25,15 +25,17 @@ module.exports = (value, options) => {
|
|
|
25
25
|
const hasExtension = existingExt !== '' && extensions.includes(existingExt);
|
|
26
26
|
const isAbsolute = fileName.indexOf('/') === 0;
|
|
27
27
|
|
|
28
|
-
// For
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
// For Vitest's internal modules and transformers, use lex node_modules
|
|
29
|
+
const isVitestModule = fileName === 'vitest' ||
|
|
30
|
+
fileName.startsWith('vitest/') ||
|
|
31
|
+
fileName.startsWith('@vitest/') ||
|
|
32
|
+
fileName === 'vite-node' ||
|
|
33
|
+
fileName.startsWith('vite-node/');
|
|
34
|
+
|
|
35
|
+
if(isVitestModule ||
|
|
32
36
|
fileName.includes('core-js') ||
|
|
33
37
|
fileName.includes('regenerator-runtime') ||
|
|
34
|
-
fileName.includes('
|
|
35
|
-
fileName.includes('@jest/') ||
|
|
36
|
-
fileName.includes('jest-sequencer-')) {
|
|
38
|
+
fileName.includes('vitest-sequencer-')) {
|
|
37
39
|
try {
|
|
38
40
|
const result = resolveSync(fileName, {basedir: pathResolve(__dirname, '../'), extensions});
|
|
39
41
|
return result;
|
package/tsconfig.build.json
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"skipLibCheck": true,
|
|
27
27
|
"target": "ESNext",
|
|
28
28
|
"types": [
|
|
29
|
-
"jest",
|
|
30
29
|
"node"
|
|
31
30
|
]
|
|
32
31
|
},
|
|
@@ -39,8 +38,9 @@
|
|
|
39
38
|
"**/*.integration.*",
|
|
40
39
|
"**/__tests__/**",
|
|
41
40
|
"**/__mocks__/**",
|
|
41
|
+
"src/vitest.d.ts",
|
|
42
42
|
"lib",
|
|
43
43
|
"node_modules",
|
|
44
|
-
"
|
|
44
|
+
"vitest.config.mjs"
|
|
45
45
|
]
|
|
46
|
-
}
|
|
46
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"skipLibCheck": true,
|
|
24
24
|
"target": "ESNext",
|
|
25
25
|
"types": [
|
|
26
|
-
"
|
|
26
|
+
"vitest/globals",
|
|
27
|
+
"@testing-library/jest-dom",
|
|
27
28
|
"node"
|
|
28
29
|
]
|
|
29
30
|
},
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
],
|
|
36
37
|
"include": [
|
|
37
38
|
"./src",
|
|
38
|
-
"./
|
|
39
|
+
"./vitest.setup.ts",
|
|
39
40
|
"./.storybook"
|
|
40
41
|
]
|
|
41
|
-
}
|
|
42
|
+
}
|
package/tsconfig.lint.json
CHANGED
package/tsconfig.template.json
CHANGED
package/tsconfig.test.json
CHANGED
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"strict": false,
|
|
30
30
|
"target": "ESNext",
|
|
31
31
|
"types": [
|
|
32
|
-
"
|
|
32
|
+
"vitest/globals",
|
|
33
|
+
"@testing-library/jest-dom",
|
|
33
34
|
"node"
|
|
34
35
|
]
|
|
35
36
|
},
|
|
@@ -39,10 +40,10 @@
|
|
|
39
40
|
"**/*.spec.*",
|
|
40
41
|
"**/*.integration.*",
|
|
41
42
|
"**/__tests__/*",
|
|
42
|
-
"
|
|
43
|
+
"vitest.setup.ts"
|
|
43
44
|
],
|
|
44
45
|
"exclude": [
|
|
45
46
|
"lib",
|
|
46
47
|
"node_modules"
|
|
47
48
|
]
|
|
48
|
-
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
import {existsSync} from 'fs';
|
|
6
|
+
import merge from 'lodash/merge.js';
|
|
7
|
+
import {resolve} from 'path';
|
|
8
|
+
import {defineConfig} from 'vitest/config';
|
|
9
|
+
|
|
10
|
+
let projectVitestConfig = null;
|
|
11
|
+
|
|
12
|
+
if(process.env.LEX_CONFIG) {
|
|
13
|
+
try {
|
|
14
|
+
const lexConfig = JSON.parse(process.env.LEX_CONFIG);
|
|
15
|
+
projectVitestConfig = lexConfig.vitest;
|
|
16
|
+
} catch(error) {
|
|
17
|
+
// eslint-disable-next-line no-console
|
|
18
|
+
console.warn('Failed to parse LEX_CONFIG:', error.message);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const setupOverride = process.env.LEX_VITEST_SETUP;
|
|
23
|
+
const defaultSetupFile = resolve(process.cwd(), 'vitest.setup.js');
|
|
24
|
+
const setupFile = setupOverride || defaultSetupFile;
|
|
25
|
+
const setupFiles = setupFile && existsSync(setupFile) ? [setupFile] : [];
|
|
26
|
+
|
|
27
|
+
const baseConfig = defineConfig({
|
|
28
|
+
resolve: {
|
|
29
|
+
alias: [
|
|
30
|
+
{
|
|
31
|
+
find: /^(\.{1,2}\/.*)\.js$/,
|
|
32
|
+
replacement: '$1'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
test: {
|
|
37
|
+
globals: true,
|
|
38
|
+
environment: 'node',
|
|
39
|
+
include: ['**/*.{test,spec,integration}.{ts,tsx,js,jsx}'],
|
|
40
|
+
exclude: ['**/node_modules/**', '**/dist/**', '**/lib/**'],
|
|
41
|
+
setupFiles,
|
|
42
|
+
coverage: {
|
|
43
|
+
provider: 'v8',
|
|
44
|
+
reportsDirectory: 'coverage',
|
|
45
|
+
reporter: ['html', 'text'],
|
|
46
|
+
exclude: [
|
|
47
|
+
'**/node_modules/**',
|
|
48
|
+
'**/dist/**',
|
|
49
|
+
'**/lib/**',
|
|
50
|
+
'**/__snapshots__/**',
|
|
51
|
+
'**/*.d.ts'
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const finalConfig = projectVitestConfig && Object.keys(projectVitestConfig).length > 0
|
|
58
|
+
? merge(baseConfig, {test: projectVitestConfig})
|
|
59
|
+
: baseConfig;
|
|
60
|
+
|
|
61
|
+
export default finalConfig;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Read Vitest config from LEX_CONFIG environment variable if available
|
|
7
|
+
let lexConfig = null;
|
|
8
|
+
if(process.env.LEX_CONFIG) {
|
|
9
|
+
try {
|
|
10
|
+
lexConfig = JSON.parse(process.env.LEX_CONFIG);
|
|
11
|
+
} catch(error) {
|
|
12
|
+
console.warn('Failed to parse LEX_CONFIG:', error.message);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const setupFile = process.env.LEX_VITEST_SETUP || '<rootDir>/vitest.setup.js';
|
|
17
|
+
|
|
18
|
+
const baseConfig = {
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: [
|
|
21
|
+
{
|
|
22
|
+
find: /^(\.{1,2}\/.*)\.js$/,
|
|
23
|
+
replacement: '$1'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
find: /\.(css|less|scss|sass)$/,
|
|
27
|
+
replacement: 'identity-obj-proxy'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
find: /\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$/,
|
|
31
|
+
replacement: '<rootDir>/__mocks__/fileMock.js'
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
test: {
|
|
36
|
+
globals: true,
|
|
37
|
+
environment: 'jsdom',
|
|
38
|
+
include: ['**/*.{test,spec,integration}.{ts,tsx,js,jsx}'],
|
|
39
|
+
setupFiles: [setupFile],
|
|
40
|
+
coverage: {
|
|
41
|
+
provider: 'v8',
|
|
42
|
+
reportsDirectory: '<rootDir>/coverage',
|
|
43
|
+
reporter: ['html', 'text'],
|
|
44
|
+
exclude: [
|
|
45
|
+
'**/node_modules/**',
|
|
46
|
+
'**/dist/**',
|
|
47
|
+
'**/lib/**',
|
|
48
|
+
'**/__snapshots__/**',
|
|
49
|
+
'**/*.d.ts'
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Merge with Lex config if available
|
|
56
|
+
if(lexConfig && lexConfig.vitest) {
|
|
57
|
+
module.exports = {
|
|
58
|
+
...baseConfig,
|
|
59
|
+
test: {
|
|
60
|
+
...baseConfig.test,
|
|
61
|
+
...lexConfig.vitest
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
} else {
|
|
65
|
+
module.exports = baseConfig;
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
|
+
import {vi} from 'vitest';
|
|
3
|
+
|
|
4
|
+
globalThis.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
5
|
+
observe: vi.fn(),
|
|
6
|
+
unobserve: vi.fn(),
|
|
7
|
+
disconnect: vi.fn()
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
globalThis.matchMedia = vi.fn().mockImplementation((query) => ({
|
|
11
|
+
matches: false,
|
|
12
|
+
media: query,
|
|
13
|
+
onchange: null,
|
|
14
|
+
addListener: vi.fn(),
|
|
15
|
+
removeListener: vi.fn(),
|
|
16
|
+
addEventListener: vi.fn(),
|
|
17
|
+
removeEventListener: vi.fn(),
|
|
18
|
+
dispatchEvent: vi.fn()
|
|
19
|
+
}));
|
package/jest.config.d.mts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let displayName: any;
|
|
3
|
-
let testEnvironment: string;
|
|
4
|
-
let moduleFileExtensions: string[];
|
|
5
|
-
let moduleDirectories: string[];
|
|
6
|
-
let moduleNameMapper: {
|
|
7
|
-
'^(\\.{1,2}/.*)\\.js$': string;
|
|
8
|
-
'^execa$': string;
|
|
9
|
-
'^boxen$': string;
|
|
10
|
-
'^chalk$': string;
|
|
11
|
-
'^ora$': string;
|
|
12
|
-
'^latest-version$': string;
|
|
13
|
-
'^compare-versions$': string;
|
|
14
|
-
'.*LexConfig.*': string;
|
|
15
|
-
'.*build\\.js$': string;
|
|
16
|
-
'.*versions\\.js$': string;
|
|
17
|
-
'.*compile\\.js$': string;
|
|
18
|
-
'utils/file\\.js$': string;
|
|
19
|
-
'.*/utils/file\\.js$': string;
|
|
20
|
-
'^(\\.{1,2}/)*utils/file\\.js$': string;
|
|
21
|
-
'.(css|less|scss|sass)$': string;
|
|
22
|
-
'.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': string;
|
|
23
|
-
};
|
|
24
|
-
let rootDir: string;
|
|
25
|
-
let transformIgnorePatterns: string[];
|
|
26
|
-
let setupFilesAfterEnv: string[];
|
|
27
|
-
let transform: {
|
|
28
|
-
'^.+.js$|^.+.jsx$': (string | {
|
|
29
|
-
presets: (string | (string | {
|
|
30
|
-
targets: {
|
|
31
|
-
node: string;
|
|
32
|
-
};
|
|
33
|
-
})[])[];
|
|
34
|
-
})[];
|
|
35
|
-
'^.+.ts$|^.+.tsx$': (string | {
|
|
36
|
-
presets: (string | (string | {
|
|
37
|
-
targets: {
|
|
38
|
-
node: string;
|
|
39
|
-
};
|
|
40
|
-
})[])[];
|
|
41
|
-
})[];
|
|
42
|
-
};
|
|
43
|
-
let testRegex: string;
|
|
44
|
-
let collectCoverage: boolean;
|
|
45
|
-
let coverageDirectory: string;
|
|
46
|
-
let coveragePathIgnorePatterns: string[];
|
|
47
|
-
let coverageReporters: string[];
|
|
48
|
-
let verbose: boolean;
|
|
49
|
-
}
|
|
50
|
-
export default _default;
|
package/jest.config.mjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
|
-
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
-
*/
|
|
5
|
-
import {readFileSync} from 'fs';
|
|
6
|
-
import merge from 'lodash/merge.js';
|
|
7
|
-
import {dirname, resolve} from 'path';
|
|
8
|
-
import {fileURLToPath} from 'url';
|
|
9
|
-
|
|
10
|
-
const filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const dirnamePath = dirname(filename);
|
|
12
|
-
const pack = JSON.parse(readFileSync(resolve(dirnamePath, 'package.json'), 'utf8'));
|
|
13
|
-
|
|
14
|
-
let projectJestConfig = null;
|
|
15
|
-
|
|
16
|
-
if(process.env.LEX_CONFIG) {
|
|
17
|
-
try {
|
|
18
|
-
const lexConfig = JSON.parse(process.env.LEX_CONFIG);
|
|
19
|
-
projectJestConfig = lexConfig.jest;
|
|
20
|
-
} catch(error) {
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.warn('Failed to parse LEX_CONFIG:', error.message);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const baseConfig = {
|
|
27
|
-
collectCoverage: true,
|
|
28
|
-
coverageDirectory: '<rootDir>/coverage',
|
|
29
|
-
coveragePathIgnorePatterns: [
|
|
30
|
-
'/node_modules/',
|
|
31
|
-
'/dist',
|
|
32
|
-
'/lib',
|
|
33
|
-
'__snapshots__',
|
|
34
|
-
'.d.ts'
|
|
35
|
-
],
|
|
36
|
-
coverageReporters: ['html', 'text'],
|
|
37
|
-
displayName: pack.name,
|
|
38
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
|
|
39
|
-
moduleNameMapper: {
|
|
40
|
-
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
41
|
-
},
|
|
42
|
-
rootDir: process.cwd(),
|
|
43
|
-
testEnvironment: 'node',
|
|
44
|
-
testRegex: '(/__tests__/.*|\\.(test|spec|integration))\\.(ts|tsx)?$',
|
|
45
|
-
transform: {
|
|
46
|
-
'^.+\\.(t|j)sx?$': ['@swc/jest', {
|
|
47
|
-
jsc: {
|
|
48
|
-
parser: {
|
|
49
|
-
decorators: true,
|
|
50
|
-
dynamicImport: true,
|
|
51
|
-
syntax: 'typescript',
|
|
52
|
-
tsx: true
|
|
53
|
-
},
|
|
54
|
-
transform: {
|
|
55
|
-
react: {
|
|
56
|
-
runtime: 'automatic'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
module: {
|
|
61
|
-
type: 'es6'
|
|
62
|
-
}
|
|
63
|
-
}]
|
|
64
|
-
},
|
|
65
|
-
verbose: true
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const finalConfig = projectJestConfig && Object.keys(projectJestConfig).length > 0
|
|
69
|
-
? merge(baseConfig, projectJestConfig)
|
|
70
|
-
: baseConfig;
|
|
71
|
-
|
|
72
|
-
export default finalConfig;
|
package/jest.config.template.cjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
|
-
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Read Jest config from LEX_CONFIG environment variable if available
|
|
7
|
-
let lexConfig = null;
|
|
8
|
-
if(process.env.LEX_CONFIG) {
|
|
9
|
-
try {
|
|
10
|
-
lexConfig = JSON.parse(process.env.LEX_CONFIG);
|
|
11
|
-
} catch(error) {
|
|
12
|
-
console.warn('Failed to parse LEX_CONFIG:', error.message);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const baseConfig = {
|
|
17
|
-
collectCoverage: true,
|
|
18
|
-
coverageDirectory: '<rootDir>/coverage',
|
|
19
|
-
coveragePathIgnorePatterns: [
|
|
20
|
-
'/node_modules/',
|
|
21
|
-
'/dist',
|
|
22
|
-
'/lib',
|
|
23
|
-
'__snapshots__',
|
|
24
|
-
'.d.ts'
|
|
25
|
-
],
|
|
26
|
-
coverageReporters: ['html', 'text'],
|
|
27
|
-
moduleDirectories: ['node_modules', '<rootDir>'],
|
|
28
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
|
|
29
|
-
moduleNameMapper: {
|
|
30
|
-
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
|
31
|
-
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
|
|
32
|
-
'^(\\.{1,2}/.*)\\.js$': '$1'
|
|
33
|
-
},
|
|
34
|
-
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
35
|
-
testEnvironment: 'jsdom',
|
|
36
|
-
testRegex: '(/__tests__/.*|\\.(test|spec|integration))\\.(ts|tsx|js|jsx)?$',
|
|
37
|
-
transform: {
|
|
38
|
-
'^.+\\.(t|j)sx?$': ['@swc/jest', {
|
|
39
|
-
jsc: {
|
|
40
|
-
parser: {
|
|
41
|
-
decorators: true,
|
|
42
|
-
dynamicImport: true,
|
|
43
|
-
syntax: 'typescript',
|
|
44
|
-
tsx: true
|
|
45
|
-
},
|
|
46
|
-
transform: {
|
|
47
|
-
react: {
|
|
48
|
-
runtime: 'automatic'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
module: {
|
|
53
|
-
type: 'es6'
|
|
54
|
-
}
|
|
55
|
-
}]
|
|
56
|
-
},
|
|
57
|
-
transformIgnorePatterns: [
|
|
58
|
-
'node_modules/(?!(strip-indent|chalk|@testing-library/jest-dom|zod|@nlabs|@nlabs/arkhamjs|@nlabs/utils|@nlabs/lex)/.*)'
|
|
59
|
-
],
|
|
60
|
-
verbose: true
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// Merge with Lex config if available
|
|
64
|
-
if(lexConfig && lexConfig.jest) {
|
|
65
|
-
module.exports = {
|
|
66
|
-
...baseConfig,
|
|
67
|
-
...lexConfig.jest
|
|
68
|
-
};
|
|
69
|
-
} else {
|
|
70
|
-
module.exports = baseConfig;
|
|
71
|
-
}
|
package/jest.setup.template.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
require('@testing-library/jest-dom');
|
|
2
|
-
|
|
3
|
-
global.ResizeObserver = jest.fn().mockImplementation(() => ({
|
|
4
|
-
observe: jest.fn(),
|
|
5
|
-
unobserve: jest.fn(),
|
|
6
|
-
disconnect: jest.fn()
|
|
7
|
-
}));
|
|
8
|
-
|
|
9
|
-
global.matchMedia = jest.fn().mockImplementation((query) => ({
|
|
10
|
-
matches: false,
|
|
11
|
-
media: query,
|
|
12
|
-
onchange: null,
|
|
13
|
-
addListener: jest.fn(),
|
|
14
|
-
removeListener: jest.fn(),
|
|
15
|
-
addEventListener: jest.fn(),
|
|
16
|
-
removeEventListener: jest.fn(),
|
|
17
|
-
dispatchEvent: jest.fn()
|
|
18
|
-
}));
|