GeezerVison is showing github.com — test: fix flaky test-runner coverage threshold test · nodejs/node@3229886
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-runner-run-coverage.mjs +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -154,10 +154,13 @@ describe('require(\'node:test\').run coverage settings', { concurrency: true }, |
154 | 154 | for await (const _ of stream); |
155 | 155 | }); |
156 | 156 |
|
157 | | - await it('should run with coverage and fail when below line threshold', async () => { |
| 157 | + await it('should run with coverage and fail when below line threshold', async (t) => { |
158 | 158 | const thresholdErrors = []; |
159 | 159 | const originalExitCode = process.exitCode; |
160 | | - assert.notStrictEqual(originalExitCode, 1); |
| 160 | + t.after(() => { |
| 161 | + process.exitCode = originalExitCode; |
| 162 | + }); |
| 163 | + process.exitCode = undefined; |
161 | 164 | const stream = run({ |
162 | 165 | files, |
163 | 166 | coverage: true, |
@@ -178,7 +181,6 @@ describe('require(\'node:test\').run coverage settings', { concurrency: true }, |
178 | 181 | for await (const _ of stream); |
179 | 182 | assert.deepStrictEqual(thresholdErrors.sort(), ['branch', 'function', 'line']); |
180 | 183 | assert.strictEqual(process.exitCode, 1); |
181 | | - process.exitCode = originalExitCode; |
182 | 184 | }); |
183 | 185 | }); |
184 | 186 | }); |
|