-
Notifications
You must be signed in to change notification settings - Fork 4.9k
feat: pause on --debug
#38345
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
Merged
+317
−50
Merged
feat: pause on --debug
#38345
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
892e2ce
feat: --debug pauses test
Skn0tt bcf2fec
location
Skn0tt c40f102
proper step location
Skn0tt 4b87e41
progressively report errors
Skn0tt b26031f
tele
Skn0tt c1c9867
skip on windows
Skn0tt b515837
reporting more errors
Skn0tt 0a611bb
errors are optional
Skn0tt db2419d
mark optional for backwards compat
Skn0tt 0996534
extract into TestErrorPayload ipc
Skn0tt 8381924
mirror attachments
Skn0tt d075147
typescript
Skn0tt 7f90a0f
unflake
Skn0tt 2242b4c
style
Skn0tt 6061a29
more feedback
Skn0tt bda2662
feedback
Skn0tt 3999df2
add snippets in dispatcher
Skn0tt 807eafe
merge
Skn0tt c420d97
pass file when possible
Skn0tt c8bd245
add comment
Skn0tt dea4b7d
address
Skn0tt 22d0744
rename
Skn0tt dab17dd
rename
Skn0tt 7bf8763
maintain last error index
Skn0tt 5817b37
use onTestError
Skn0tt f768a69
remove unused map
Skn0tt 7020ccd
revert linechange
Skn0tt fa8fa14
the multiplexer!
Skn0tt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /** | ||
| * Copyright (c) Microsoft Corporation. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import path from 'path'; | ||
| import { traverse, babelParse, T, types as t } from './babelBundle'; | ||
| import type { Location } from '../../types/testReporter'; | ||
|
|
||
| function containsLocation(range: T.SourceLocation, location: Location): boolean { | ||
| if (location.line < range.start.line || location.line > range.end.line) | ||
| return false; | ||
| if (location.line === range.start.line && location.column < range.start.column) | ||
| return false; | ||
| if (location.line === range.end.line && location.column > range.end.column) | ||
| return false; | ||
| return true; | ||
| } | ||
|
|
||
| export function findTestEndLocation(text: string, testStartLocation: Location): Location | undefined { | ||
| const ast = babelParse(text, path.basename(testStartLocation.file), false); | ||
| let result: Location | undefined; | ||
| traverse(ast, { | ||
| enter(path) { | ||
| if (t.isCallExpression(path.node) && path.node.loc && containsLocation(path.node.loc, testStartLocation)) { | ||
| const callNode = path.node; | ||
| const funcNode = callNode.arguments[callNode.arguments.length - 1]; | ||
| if (callNode.arguments.length >= 2 && t.isFunction(funcNode) && funcNode.body.loc) | ||
| result = { file: testStartLocation.file, ...funcNode.body.loc.end }; | ||
| } | ||
| } | ||
| }); | ||
| return result; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.