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

Commit d24ae85

Browse files
authored
Support --expand/--no-expand flag (#107)
1 parent 37bcf92 commit d24ae85

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- name: Prepare for Node.js v14
6262
if: ${{ matrix.node == '14' }}
6363
run: |
64+
yarn set version 3
65+
yarn config set httpRetry 10
66+
cat .yarnrc.yml
6467
node ./scripts/prepare-test-for-legacy-nodejs.js --node-version ${{ matrix.node }}
6568
cat package.json
6669
yarn
@@ -77,7 +80,7 @@ jobs:
7780
NODE_ENV: production
7881
FULL_TEST: true
7982
run: |
80-
node ./node_modules/.bin/jest ${{ matrix.additional-options }}
83+
yarn test:production-node14 ${{ matrix.additional-options }}
8184
8285
babel:
8386
name: Babel

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The lists below are not comprehensive: feel free to [start a discussion](https:/
1414
- Jest function mocks: `jest.fn`, `jest.spyOn`, `jest.clearAllMocks`, `jest.resetAllMocks`
1515
- Jest timer mocks: `jest.useFakeTimers`, `jest.useRealTimers`, `jest.setSystemTime`, `jest.advanceTimersByTime`
1616
- Inline and external snapshots
17-
- Jest cli options: `--testNamePattern`/`-t`, `--maxWorkers`, `--runInBand`
17+
- Jest cli options: `--testNamePattern`/`-t`, `--maxWorkers`, `--runInBand`, `--expand`, `--no-expand`
1818
- Jest config options: `setupFiles`, `setupFilesAfterEnv`, `snapshotSerializers`, `maxWorkers`, `snapshotFormat`, `snapshotResolver`, `slowTestThreshold`, `prettierPath`, `projects`
1919
- Jest environment variables: `JEST_WORKER_ID`
2020

src/worker-runner.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ export default async function run(testFilePath) {
115115
updateSnapshot: globalConfig.updateSnapshot,
116116
},
117117
);
118-
expect.setState({ snapshotState, testPath: testFilePath });
118+
expect.setState({
119+
snapshotState,
120+
testPath: testFilePath,
121+
expand: globalConfig.expand,
122+
});
119123

120124
const { tests, hasFocusedTests } = await loadTests(testFilePath);
121125

0 commit comments

Comments
 (0)