test: fix several bazel compiler-cli tests in windows (#30189)

```
//packages/compiler-cli/integrationtest:integrationtest
//packages/compiler-cli/test/compliance:compliance
```

Partially addresses #29785

PR Close #30189
This commit is contained in:
Alan
2019-04-30 10:18:20 +02:00
committed by Kara Erickson
parent b40f6f3eae
commit 1660b34e2d
3 changed files with 17 additions and 16 deletions

View File

@ -98,13 +98,8 @@ function symlinkNodeModules() {
Object.keys(requiredNodeModules).forEach(importName => {
const outputPath = path.join(tmpDir, 'node_modules', importName);
const moduleDir = requiredNodeModules[importName];
findFilesWithinDirectory(moduleDir).forEach(filePath => {
const outputFilePath = path.join(outputPath, path.relative(moduleDir, filePath));
shx.mkdir('-p', path.dirname(outputFilePath));
fs.symlinkSync(filePath, outputFilePath);
});
shx.mkdir('-p', path.dirname(outputPath));
fs.symlinkSync(moduleDir, outputPath, 'junction');
});
}
@ -162,5 +157,5 @@ function resolveNpmTreeArtifact(manifestPath, resolveFile = 'package.json') {
/** Finds all files within a specified directory. */
function findFilesWithinDirectory(directoryPath) {
return shx.find(directoryPath).filter(filePath => !fs.statSync(filePath).isDirectory());
return shx.find(directoryPath).filter(filePath => !fs.lstatSync(filePath).isDirectory());
}