|
| 1 | +import { noop } from "../../_namespaces/ts.js"; |
1 | 2 | import { dedent } from "../../_namespaces/Utils.js";
|
2 | 3 | import * as vfs from "../../_namespaces/vfs.js";
|
3 | 4 | import { jsonToReadableText } from "../helpers.js";
|
@@ -90,6 +91,57 @@ describe("unittests:: tsbuild:: with rootDir of project reference in parentDirec
|
90 | 91 | edits: noChangeOnlyRuns,
|
91 | 92 | });
|
92 | 93 |
|
| 94 | + verifyTsc({ |
| 95 | + scenario: "projectReferenceWithRootDirInParent", |
| 96 | + subScenario: "reports error for same tsbuildinfo file without incremental", |
| 97 | + fs: () => projFs, |
| 98 | + commandLineArgs: ["--b", "/src/src/main", "--verbose"], |
| 99 | + modifyFs: fs => { |
| 100 | + fs.writeFileSync( |
| 101 | + "/src/src/main/tsconfig.json", |
| 102 | + jsonToReadableText({ |
| 103 | + compilerOptions: { outDir: "../../dist/" }, |
| 104 | + references: [{ path: "../other" }], |
| 105 | + }), |
| 106 | + ); |
| 107 | + fs.writeFileSync( |
| 108 | + "/src/src/other/tsconfig.json", |
| 109 | + jsonToReadableText({ |
| 110 | + compilerOptions: { composite: true, outDir: "../../dist/" }, |
| 111 | + }), |
| 112 | + ); |
| 113 | + }, |
| 114 | + }); |
| 115 | + |
| 116 | + verifyTsc({ |
| 117 | + scenario: "projectReferenceWithRootDirInParent", |
| 118 | + subScenario: "reports error for same tsbuildinfo file without incremental with tsc", |
| 119 | + fs: () => projFs, |
| 120 | + commandLineArgs: ["--b", "/src/src/other", "--verbose"], |
| 121 | + modifyFs: fs => { |
| 122 | + fs.writeFileSync( |
| 123 | + "/src/src/main/tsconfig.json", |
| 124 | + jsonToReadableText({ |
| 125 | + compilerOptions: { outDir: "../../dist/" }, |
| 126 | + references: [{ path: "../other" }], |
| 127 | + }), |
| 128 | + ); |
| 129 | + fs.writeFileSync( |
| 130 | + "/src/src/other/tsconfig.json", |
| 131 | + jsonToReadableText({ |
| 132 | + compilerOptions: { composite: true, outDir: "../../dist/" }, |
| 133 | + }), |
| 134 | + ); |
| 135 | + }, |
| 136 | + edits: [ |
| 137 | + { |
| 138 | + caption: "Running tsc on main", |
| 139 | + edit: noop, |
| 140 | + commandLineArgs: ["-p", "/src/src/main"], |
| 141 | + }, |
| 142 | + ], |
| 143 | + }); |
| 144 | + |
93 | 145 | verifyTsc({
|
94 | 146 | scenario: "projectReferenceWithRootDirInParent",
|
95 | 147 | subScenario: "reports no error when tsbuildinfo differ",
|
|
0 commit comments