Skip to content

Commit 411f4a2

Browse files
committed
fix another test
1 parent 2c2801a commit 411f4a2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

e2e/__tests__/__snapshots__/showConfig.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
7474
"/node_modules/"
7575
],
7676
"testRegex": [],
77-
"testRunner": "<<REPLACED_JEST_PACKAGES_DIR>>/jest-circus/runner.js",
77+
"testRunner": "<<REPLACED_JEST_PACKAGES_DIR>>/jest-circus/build/runner.js",
7878
"transform": [
7979
[
8080
"\\\\.[jt]sx?$",

packages/jest-cli/src/init/__tests__/init.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import init from '../';
1515
const {JEST_CONFIG_EXT_ORDER} = constants;
1616

1717
jest.mock('prompts');
18-
jest.mock(
19-
'../../../../jest-config/build/getCacheDirectory',
20-
() => () => '/tmp/jest',
21-
);
2218
jest.mock('path', () => ({
2319
...jest.requireActual<typeof import('path')>('path'),
2420
sep: '/',
@@ -52,7 +48,12 @@ describe('init', () => {
5248

5349
const writtenJestConfig = jest.mocked(writeFileSync).mock.calls[0][1];
5450

55-
expect(writtenJestConfig).toMatchSnapshot();
51+
expect(
52+
writtenJestConfig.replace(
53+
/\/\/ cacheDirectory: .*,/,
54+
'// cacheDirectory: "/tmp/jest",',
55+
),
56+
).toMatchSnapshot();
5657

5758
const evaluatedConfig = eval(writtenJestConfig as string) as Record<
5859
string,

0 commit comments

Comments
 (0)