Skip to content

Commit 452c501

Browse files
test(schematics): key the compile host on the path TypeScript asks for
The four "output compiles" specs failed on Windows only. `path.resolve` returns backslashes there, TypeScript rewrites a root name's separators before asking the compiler host for that file, and the host's exact-match comparison then missed its own in-memory file. Every Windows job reported TS6053 for a file it had been handed. Reproduced on macOS by keying the host on a backslash path, since TypeScript's slash rewriting is not limited to Windows.
1 parent 77a056f commit 452c501

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/schematics/update/v21/vertexai-to-ai.jasmine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('rewriteVertexAIToAI', () => {
129129
* node_modules the way it would in a user's workspace.
130130
*/
131131
const compile = (source: string): string[] => {
132-
const filePath = resolve('migrated-output.ts');
132+
const filePath = resolve('migrated-output.ts').replace(/\\/g, '/');
133133
const host = typescript.createCompilerHost(compilerOptions, true);
134134
const readFromDisk = host.getSourceFile.bind(host);
135135
const existsOnDisk = host.fileExists.bind(host);

0 commit comments

Comments
 (0)