Skip to content

Commit ca748cf

Browse files
committed
fix: Allow temp folder cleanup to complete normally
1 parent 2f788d0 commit ca748cf

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/__tests__/index.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,26 @@ describe('@ryaninvents/plugin-bundle-dependencies', () => {
159159
expect(stderr).not.toMatch('ENOTEMPTY');
160160
}, 60e3);
161161

162+
it('should not produce ENOENT error', async () => {
163+
const { workingDir } = await initRepo({
164+
packageJson: {
165+
...DEFAULT_PKG_JSON,
166+
dependencies: {
167+
// Use a couple of packages known to basically be one-liners
168+
// in order to test quickly
169+
'is-sorted': 'latest',
170+
'map-obj': 'latest'
171+
}
172+
},
173+
stdio: 'inherit'
174+
});
175+
const { stderr } = await execa('npm', ['run', 'build'], {
176+
env: { NODE_ENV: 'production' },
177+
cwd: workingDir
178+
});
179+
expect(stderr).not.toMatch('ENOENT');
180+
}, 60e3);
181+
162182
it('should observe `prefix` option', async () => {
163183
const { workingDir } = await initRepo({
164184
packageJson: {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ export async function build ({ cwd, out, manifest, reporter, options }) {
4040

4141
reporter.created(join(out, ZIP_FILENAME), `zip:dependencies`);
4242

43-
await del([tempWorkingDir], { force: true });
43+
await del([`${tempWorkingDir}/*`], { force: true });
4444
}

0 commit comments

Comments
 (0)