| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -801,6 +801,9 @@ export class Vitest { | |||
| 801 | 801 | const testModules = await this.parseSpecifications(files, { | |
| 802 | 802 | concurrency: options.staticParseConcurrency, | |
| 803 | 803 | }) | |
| 804 | + if (hasFailed(testModules.map(testModule => testModule.task))) { | ||
| 805 | + process.exitCode = 1 | ||
| 806 | + } | ||
| 804 | 807 | return { testModules, unhandledErrors: [] } | |
| 805 | 808 | } | |
| 806 | 809 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,11 @@ Error: top level error | |||
| 19 | 19 | " | |
| 20 | 20 | `; | |
| 21 | 21 | ||
| 22 | + exports[`basic output shows error with static parsing 1`] = ` | ||
| 23 | + "Error: No test suite found in file <root>/fixtures/list/top-level-error.test.ts | ||
| 24 | + " | ||
| 25 | + `; | ||
| 26 | + | ||
| 22 | 27 | exports[`correctly outputs all tests with args: "--browser.enabled" 1`] = ` | |
| 23 | 28 | "[chromium] basic.test.ts > basic suite > inner suite > some test | |
| 24 | 29 | [chromium] basic.test.ts > basic suite > inner suite > another test | |
@@ -104,6 +109,11 @@ Error: top level error | |||
| 104 | 109 | " | |
| 105 | 110 | `; | |
| 106 | 111 | ||
| 112 | + exports[`json output shows error with static parsing 1`] = ` | ||
| 113 | + "Error: No test suite found in file <root>/fixtures/list/top-level-error.test.ts | ||
| 114 | + " | ||
| 115 | + `; | ||
| 116 | + | ||
| 107 | 117 | exports[`json with a file output shows error 1`] = ` | |
| 108 | 118 | "Error: describe error | |
| 109 | 119 | ❯ describe-error.test.ts:4:9 | |
@@ -122,3 +132,8 @@ Error: top level error | |||
| 122 | 132 | ||
| 123 | 133 | " | |
| 124 | 134 | `; | |
| 135 | + | ||
| 136 | + exports[`json with a file output shows error with static parsing 1`] = ` | ||
| 137 | + "Error: No test suite found in file <root>/fixtures/list/top-level-error.test.ts | ||
| 138 | + " | ||
| 139 | + `; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,17 @@ test.each([ | |||
| 27 | 27 | expect(exitCode).toBe(1) | |
| 28 | 28 | }) | |
| 29 | 29 | ||
| 30 | + test.each([ | ||
| 31 | + ['basic'], | ||
| 32 | + ['json', '--json'], | ||
| 33 | + ['json with a file', '--json=./list.json'], | ||
| 34 | + ])('%s output shows error with static parsing', async (_, ...args) => { | ||
| 35 | + const { stderr, stdout, exitCode } = await runVitestCli('list', '-r=./fixtures/list', '-c=fail.config.ts', ...args) | ||
| 36 | + expect(stdout).toBe('') | ||
| 37 | + expect(relative(stderr)).toMatchSnapshot() | ||
| 38 | + expect(exitCode).toBe(1) | ||
| 39 | + }) | ||
| 40 | + | ||
| 30 | 41 | test('correctly outputs json', async () => { | |
| 31 | 42 | const { stdout, exitCode } = await runVitestCli('list', '-r=./fixtures/list', '--json') | |
| 32 | 43 | expect(relative(stdout)).toMatchInlineSnapshot(` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments