[node] Fix 11-symlinks integration test fixture (#7823)

The `symlink` symlink wasn't being persisted through Turbo's cache,
so this test was failing. So move the symlink directly into the git repo
since there's no need to create it at build-time (git can store symlinks
just fine).

Additionally, the test itself was not testing that the symlink was indeed
re-created as a symlink from within the lambda environment (it actually
wasn't, due to the upload code not considering symlinks), so the test
has been updated to test for that as well.
This commit is contained in:
Nathan Rajlich
2022-05-18 22:04:58 -07:00
committed by GitHub
parent f26858b735
commit acd756436c
6 changed files with 18 additions and 12 deletions

View File

@@ -257,9 +257,16 @@ async function testDeployment(
dot: true,
});
const bodies = globResult.reduce((b, f) => {
let data;
const r = path.relative(fixturePath, f);
b[r] = fs.readFileSync(f);
b[r][fileModeSymbol] = fs.statSync(f).mode;
const stat = fs.lstatSync(f);
if (stat.isSymbolicLink()) {
data = Buffer.from(fs.readlinkSync(f), 'utf8');
} else {
data = fs.readFileSync(f);
}
data[fileModeSymbol] = stat.mode;
b[r] = data;
return b;
}, {});