Skip to content

Commit a756a12

Browse files
authored
use temp dir
1 parent ebb070f commit a756a12

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test/sea/test-build-sea-custom-argv0.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,31 @@ const { skipIfBuildSEAIsNotSupported } = require('../common/sea');
77

88
skipIfBuildSEAIsNotSupported();
99

10+
const tmpdir = require('../common/tmpdir');
1011
const { resolve } = require('path');
1112
const fixtures = require('../common/fixtures');
12-
const { rmSync } = require('fs');
13+
const { copyFileSync } = require('fs');
1314

1415
const { spawnSyncAndAssert } = require('../common/child_process');
16+
1517
const fixturesDir = fixtures.path('sea', 'basic');
18+
const tempDir = tmpdir.path;
19+
20+
copyFileSync(
21+
resolve(fixturesDir, 'sea-config.json'),
22+
resolve(tempDir, 'sea-config.json')
23+
);
24+
25+
copyFileSync(
26+
resolve(fixturesDir, 'sea.js'),
27+
resolve(tempDir, 'sea.js')
28+
);
1629

1730
spawnSyncAndAssert(
1831
process.execPath,
19-
['--build-sea', resolve(fixturesDir, 'sea-config.json')], {
20-
cwd: fixturesDir,
32+
['--build-sea', resolve(tempDir, 'sea-config.json')], {
33+
cwd: tempDir,
2134
argv0: 'argv0',
2235
}, {
2336
stdout: /Generated single executable/,
2437
});
25-
26-
rmSync(resolve(fixturesDir, 'sea'));

0 commit comments

Comments
 (0)