Skip to content

Commit ecedc98

Browse files
Copilotgarrytrinder
andcommitted
test: verify env is passed to ShellExecution in task provider test
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
1 parent 660bef1 commit ecedc98

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/test/task-provider.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ suite('DevProxyTaskProvider', () => {
165165
test('should handle env in definition', () => {
166166
const provider = new DevProxyTaskProvider(mockContext);
167167

168+
const env = { 'NODE_ENV': 'test', 'DEBUG': 'true' };
168169
const taskDefinition = {
169170
type: 'devproxy',
170171
command: 'start' as const,
171-
env: { 'NODE_ENV': 'test', 'DEBUG': 'true' },
172+
env,
172173
label: 'Start with Env',
173174
};
174175

@@ -182,6 +183,8 @@ suite('DevProxyTaskProvider', () => {
182183
const resolved = provider.resolveTask(mockTask);
183184

184185
assert.ok(resolved, 'Should resolve task with env');
186+
const execution = resolved!.execution as vscode.ShellExecution;
187+
assert.deepStrictEqual(execution.options?.env, env, 'Should pass env to shell execution options');
185188
});
186189
});
187190

0 commit comments

Comments
 (0)