Skip to content

Commit fb0fa8d

Browse files
committed
negative test case against provideTerminalLinks
1 parent c98e18d commit fb0fa8d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/terminals/shellIntegration/pythonStartup.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,21 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
177177
assert.equal(links[0].tooltip, Repl.launchNativeRepl, 'Expected tooltip to be Launch VS Code Native REPL');
178178
}
179179
});
180+
181+
test('Verify provideTerminalLinks returns no links when context.line does not contain expectedNativeLink', () => {
182+
const provider = new CustomTerminalLinkProvider();
183+
const context: TerminalLinkContext = {
184+
line: 'Some random string without the expected link',
185+
terminal: {} as Terminal,
186+
};
187+
const token: CancellationToken = {
188+
isCancellationRequested: false,
189+
onCancellationRequested: new EventEmitter<unknown>().event,
190+
};
191+
192+
const links = provider.provideTerminalLinks(context, token);
193+
194+
assert.isArray(links, 'Expected links to be an array');
195+
assert.isEmpty(links, 'Expected links to be empty');
196+
});
180197
});

0 commit comments

Comments
 (0)