chore: renaming to use targetPath rather than templatePath like the rest of the preparers

This commit is contained in:
blam
2021-02-12 22:54:20 +01:00
parent d84df12d3b
commit 3957c024f5
2 changed files with 6 additions and 6 deletions
@@ -28,7 +28,7 @@ describe('File preparer', () => {
const preparer = new FilePreparer();
const root = os.platform() === 'win32' ? 'C:\\' : '/';
const workspacePath = path.join(root, 'tmp');
const checkoutPath = path.resolve(workspacePath, 'checkout');
const targetPath = path.resolve(workspacePath, 'template');
await preparer.prepare({
url: `file:///${root}path/to/template`,
@@ -37,12 +37,12 @@ describe('File preparer', () => {
});
expect(fs.copy).toHaveBeenCalledWith(
path.join(root, 'path', 'to', 'template'),
checkoutPath,
targetPath,
{
recursive: true,
},
);
expect(fs.ensureDir).toHaveBeenCalledWith(checkoutPath);
expect(fs.ensureDir).toHaveBeenCalledWith(targetPath);
await expect(
preparer.prepare({
@@ -25,12 +25,12 @@ export class FilePreparer implements PreparerBase {
throw new InputError(`Wrong location protocol, should be 'file', ${url}`);
}
const templateDir = path.join(workspacePath, 'template');
await fs.ensureDir(templateDir);
const targetDir = path.join(workspacePath, 'template');
await fs.ensureDir(targetDir);
const templatePath = fileURLToPath(url);
await fs.copy(templatePath, templateDir, {
await fs.copy(templatePath, targetDir, {
recursive: true,
});
}