Skip to content

Commit 6fd7fe9

Browse files
committed
test(setup): allow node import test fixtures to optionally run install scripts
1 parent 6efd84d commit 6fd7fe9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/setup.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ export interface DummyDirectoriesFixtureOptions {
463463
// TODO: XXX: make this into a separate (mock-fixture) package (along w/ below)
464464
export interface NodeImportTestFixtureOptions {
465465
npmInstall?: string | string[];
466+
runInstallScripts?: boolean;
466467
runWith?: {
467468
binary?: string;
468469
args?: string[];
@@ -645,7 +646,13 @@ export function npmCopySelfFixture(): MockFixture {
645646

646647
await run(
647648
'npm',
648-
['install', '--no-save', '--ignore-scripts', '--production', '--force'],
649+
[
650+
'install',
651+
'--no-save',
652+
...(context.options.runInstallScripts ? [] : ['--ignore-scripts']),
653+
'--production',
654+
'--force'
655+
],
649656
{
650657
cwd: destinationPath,
651658
reject: true,
@@ -908,7 +915,7 @@ export async function withMockedFixture<
908915
CustomContext;
909916
type CustomizedMockFixture = MockFixture<CustomizedFixtureContext>;
910917

911-
const testSymbol = Symbol('test');
918+
const testSymbol = Symbol.for('@xunnamius/test');
912919
const finalOptions = {
913920
performCleanup: true,
914921
use: [] as MockFixture[],

0 commit comments

Comments
 (0)