Skip to content

Commit f7097d5

Browse files
committed
test: Fix broken setup
1 parent aa5d7be commit f7097d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/build-fixture.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,22 @@ export const getBuildScript = async (fixturePath, defaultScript) => {
4242

4343
export const buildDirectory = async fixtureDir => {
4444
let fixturePath = resolve(FIXTURES_DIR, fixtureDir);
45+
4546
if (fixtureDir.endsWith('-with-cwd')) {
4647
fixturePath = resolve(fixturePath, fixtureDir.replace('-with-cwd', ''));
4748
}
4849

49-
const dist = resolve(`${fixturePath}/dist`);
50-
// clean up
51-
await rimraf(dist);
5250
if (!fixturePath.endsWith('ts-custom-declaration')) {
5351
await rimraf(resolve(`${fixturePath}/types`));
5452
}
5553
await rimraf(resolve(`${fixturePath}/.rts2_cache_cjs`));
5654
await rimraf(resolve(`${fixturePath}/.rts2_cache_es`));
5755
await rimraf(resolve(`${fixturePath}/.rts2_cache_umd`));
5856

57+
// Now that dirs have been cleared, reset the fixturePath back to the parent dir
58+
if (fixtureDir.endsWith('-with-cwd')) {
59+
fixturePath = resolve(FIXTURES_DIR, fixtureDir);
60+
}
5961
const script = await getBuildScript(fixturePath, DEFAULT_SCRIPT);
6062

6163
const prevDir = process.cwd();

0 commit comments

Comments
 (0)