豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 4f55142

Browse files
authored
Initialize snapshot state before loading tests (#105)
1 parent cdacadb commit 4f55142

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/worker-runner.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export default async function run(testFilePath) {
105105
const stats = { passes: 0, failures: 0, pending: 0, start: 0, end: 0 };
106106
/** @type {Array<InternalTestResult>} */
107107
const results = [];
108-
const { tests, hasFocusedTests } = await loadTests(testFilePath);
109108

110109
// https://github.com/jestjs/jest/blob/0c44e271f2e4308c20c81c67e12bacbbb0b2d68f/packages/jest-jasmine2/src/setup_jest_globals.ts#L106C1-L116C6
111110
const snapshotState = new snapshot.SnapshotState(
@@ -118,6 +117,8 @@ export default async function run(testFilePath) {
118117
);
119118
expect.setState({ snapshotState, testPath: testFilePath });
120119

120+
const { tests, hasFocusedTests } = await loadTests(testFilePath);
121+
121122
stats.start = performance.now();
122123
await runTestBlock(tests, hasFocusedTests, testNamePatternRE, results, stats);
123124
stats.end = performance.now();

0 commit comments

Comments
 (0)