test(compiler-cli): error when running tests on non-posix systems (#39005)
We weren't resolving a path correctly which resulted in an error on Windows. For reference, here's the error. Note the extra slash before `C:`: ``` Error: ENOENT: no such file or directory, scandir '/C:/bazel_output_root/yxvwd24o/external/npm/node_modules/typescript' at Object.readdirSync (fs.js:854:3) ``` PR Close #39005
This commit is contained in:
parent
4fd635a03a
commit
3f9be429fc
|
@ -77,7 +77,9 @@ export function loadFakeCore(fs: FileSystem, basePath: string = '/') {
|
|||
|
||||
function loadFolder(path: string): Folder {
|
||||
const tmpFs = new MockFileSystemPosix(true);
|
||||
loadTestDirectory(tmpFs, tmpFs.resolve(path), tmpFs.resolve('/'));
|
||||
// Note that we intentionally pass the native `path`, without resolving it through the file
|
||||
// system, because the mock posix file system may break paths coming from a non-posix system.
|
||||
loadTestDirectory(tmpFs, path, tmpFs.resolve('/'));
|
||||
return tmpFs.dump();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue