| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ede52bc commit 1865691
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -384,6 +384,9 @@ function countCompletedTest(test, harness = test.root.harness) { | |||
| 384 | 384 | } | |
| 385 | 385 | if (test.reportedType === 'suite') { | |
| 386 | 386 | harness.counters.suites++; | |
| 387 | + if (!test.passed) { | ||
| 388 | + harness.success = false; | ||
| 389 | + } | ||
| 387 | 390 | return; | |
| 388 | 391 | } | |
| 389 | 392 | // Check SKIP and TODO tests first, as those should not be counted as | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const { describe, it } = require('node:test'); | ||
| 3 | + | ||
| 4 | + describe('should fail', () => { | ||
| 5 | + throw new Error('error in describe'); | ||
| 6 | + }); | ||
| 7 | + | ||
| 8 | + describe('should pass', () => { | ||
| 9 | + it('ok', () => {}); | ||
| 10 | + }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,14 @@ if (process.argv[2] === 'child') { | |||
| 70 | 70 | assert.strictEqual(child.status, 1); | |
| 71 | 71 | assert.strictEqual(child.signal, null); | |
| 72 | 72 | ||
| 73 | + // An error thrown inside describe() should cause a non-zero exit code. | ||
| 74 | + child = spawnSync(process.execPath, [ | ||
| 75 | + '--test', | ||
| 76 | + fixtures.path('test-runner', 'describe_error.js'), | ||
| 77 | + ]); | ||
| 78 | + assert.strictEqual(child.status, 1); | ||
| 79 | + assert.strictEqual(child.signal, null); | ||
| 80 | + | ||
| 73 | 81 | // With process isolation (default), the test name shown is the file path | |
| 74 | 82 | // because the parent runner only knows about file-level tests | |
| 75 | 83 | const neverEndingSync = fixtures.path('test-runner', 'never_ending_sync.js'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments