@@ -587,18 +587,20 @@ func TestBuildExitStatusForTypeErrors(t *testing.T) { |
587 | 587 | assert.Equal(t, result.Status, tsc.ExitStatusSuccess) |
588 | 588 | }) |
589 | 589 |
|
590 | | - t.Run("build reports outputs generated if any project builds", func(t *testing.T) { |
591 | | - t.Parallel() |
592 | | - sys := newTestSys(&tscInput{files: FileMap{ |
593 | | - "/home/src/workspaces/project/tsconfig.json": `{ "files": [], "references": [{ "path": "./good" }, { "path": "./bad" }] }`, |
594 | | - "/home/src/workspaces/project/good/tsconfig.json": `{ "compilerOptions": { "composite": true } }`, |
595 | | - "/home/src/workspaces/project/good/index.ts": cleanCode, |
596 | | - "/home/src/workspaces/project/bad/tsconfig.json": `{ "compilerOptions": { "composite": true } }`, |
597 | | - "/home/src/workspaces/project/bad/index.ts": typeError, |
598 | | - }}, false) |
599 | | - result := execute.CommandLine(t.Context(), sys, []string{"--build"}, sys) |
600 | | - assert.Equal(t, result.Status, tsc.ExitStatusDiagnosticsPresent_OutputsGenerated) |
601 | | - }) |
| 590 | + for _, noEmitOnError := range []bool{false, true} { |
| 591 | + t.Run(fmt.Sprintf("build reports outputs generated if any project builds/noEmitOnError=%t", noEmitOnError), func(t *testing.T) { |
| 592 | + t.Parallel() |
| 593 | + sys := newTestSys(&tscInput{files: FileMap{ |
| 594 | + "/home/src/workspaces/project/tsconfig.json": `{ "files": [], "references": [{ "path": "./good" }, { "path": "./bad" }] }`, |
| 595 | + "/home/src/workspaces/project/good/tsconfig.json": `{ "compilerOptions": { "composite": true } }`, |
| 596 | + "/home/src/workspaces/project/good/index.ts": cleanCode, |
| 597 | + "/home/src/workspaces/project/bad/tsconfig.json": fmt.Sprintf(`{ "compilerOptions": { "composite": true, "noEmitOnError": %t } }`, noEmitOnError), |
| 598 | + "/home/src/workspaces/project/bad/index.ts": typeError, |
| 599 | + }}, false) |
| 600 | + result := execute.CommandLine(t.Context(), sys, []string{"--build"}, sys) |
| 601 | + assert.Equal(t, result.Status, tsc.ExitStatusDiagnosticsPresent_OutputsGenerated) |
| 602 | + }) |
| 603 | + } |
602 | 604 |
|
603 | 605 | t.Run("build reports outputs skipped if every project reports diagnostics", func(t *testing.T) { |
604 | 606 | t.Parallel() |
|