Skip to content

Commit 695acbc

Browse files
committed
refactor: add int test for env vars
1 parent 47bc389 commit 695acbc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/nx-plugin/src/executors/cli/executor.int.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,28 @@ describe('runAutorunExecutor', () => {
5353
},
5454
});
5555
});
56+
57+
it('should execute command with provided env vars', async () => {
58+
const output = await runAutorunExecutor(
59+
{
60+
verbose: true,
61+
env: {
62+
NODE_OPTIONS: '--import tsx',
63+
TSX_TSCONFIG_PATH: 'tsconfig.base.json',
64+
},
65+
},
66+
executorContext('utils'),
67+
);
68+
expect(output.success).toBe(true);
69+
70+
expect(executeProcessSpy).toHaveBeenCalledTimes(1);
71+
expect(executeProcessSpy).toHaveBeenCalledWith(
72+
expect.objectContaining({
73+
env: {
74+
NODE_OPTIONS: '--import tsx',
75+
TSX_TSCONFIG_PATH: 'tsconfig.base.json',
76+
},
77+
}),
78+
);
79+
});
5680
});

0 commit comments

Comments
 (0)