Add extra template fetch test

Signed-off-by: Marcus Crane <marcus@utf9k.net>
This commit is contained in:
Marcus Crane
2022-08-16 21:14:30 +12:00
parent 096631e571
commit 97ac823201
@@ -297,6 +297,9 @@ describe('fetch:template', () => {
symlink: mockFs.symlink({
path: 'a-binary-file.png',
}),
brokenSymlink: mockFs.symlink({
path: './not-a-real-file.txt'
})
},
});
@@ -371,6 +374,17 @@ describe('fetch:template', () => {
fs.realpath(`${workspacePath}/target/symlink`),
).resolves.toBe(joinPath(workspacePath, 'target', 'a-binary-file.png'));
});
it('copies broken symlinks as-is without processing them', async () => {
await expect(
fs
.lstat(`${workspacePath}/target/brokenSymlink`)
.then(i => i.isSymbolicLink()),
).resolves.toBe(true);
await expect(
fs.readlink(`${workspacePath}/target/brokenSymlink`)
).resolves.toEqual('./not-a-real-file.txt');
})
});
});