-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add some more tests, fix terminal completion bug #234696
Conversation
const testSpecs: ITestSpec[] = [ | ||
{ input: '|', expectedCompletionLabels: availableCommands }, | ||
{ input: 'c|', expectedCompletionLabels: availableCommands }, | ||
{ input: 'ls && c|', expectedCompletionLabels: availableCommands }, | ||
{ input: '|', expectedCompletionLabels: availableCommands, resourcesRequested: 'both' }, | ||
{ input: 'c|', expectedCompletionLabels: availableCommands.filter(c => c.startsWith('c')) }, | ||
{ input: 'ls && c|', expectedCompletionLabels: availableCommands.filter(c => c.startsWith('c')) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll want to isolate the tests a little more or they'll just get more complicated over time. So instead of having all tests use all completions, have most unit tests focus on specific completion specs, then a small amount that deal with merging and dealing with all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, have just been fixing bugs for now. seems like something to defer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was that ITestSpec2
interface we wrote up together 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const testSpecs: ITestSpec[] = [ | ||
{ input: '|', expectedCompletionLabels: availableCommands }, | ||
{ input: 'c|', expectedCompletionLabels: availableCommands }, | ||
{ input: 'ls && c|', expectedCompletionLabels: availableCommands }, | ||
{ input: '|', expectedCompletionLabels: availableCommands, resourcesRequested: 'both' }, | ||
{ input: 'c|', expectedCompletionLabels: availableCommands.filter(c => c.startsWith('c')) }, | ||
{ input: 'ls && c|', expectedCompletionLabels: availableCommands.filter(c => c.startsWith('c')) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moves the rest of the code that deals with completions into the function that we're testing, so now truly represents what's being returned.
Added tests cases for the bug and made the fixes so that they now pass.
fix #234667