forked from jest-community/vscode-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full parameterized tests support (jest-community#649)
- Loading branch information
1 parent
c8ba11e
commit 0a96497
Showing
24 changed files
with
744 additions
and
249 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,19 +1,30 @@ | ||
import * as vscode from 'vscode'; | ||
import { TestIdentifier } from '../TestResults'; | ||
|
||
export type DebugTestIdentifier = string | TestIdentifier; | ||
export class DebugCodeLens extends vscode.CodeLens { | ||
readonly fileName: string; | ||
readonly testName: string; | ||
readonly testIds: DebugTestIdentifier[]; | ||
readonly document: vscode.TextDocument; | ||
|
||
/** | ||
* | ||
* @param document | ||
* @param range | ||
* @param fileName | ||
* @param testIds test name/pattern. | ||
* Because a test block can have multiple test results, such as for paramertized tests (i.e. test.each/describe.each), there could be multiple debuggable candidates, thus it takes multiple test identifiers. | ||
* Noite: If a test id is a string array, it should represent the hierarchiical relationship of a test structure, such as [describe-id, test-id]. | ||
*/ | ||
constructor( | ||
document: vscode.TextDocument, | ||
range: vscode.Range, | ||
fileName: string, | ||
testName: string | ||
...testIds: DebugTestIdentifier[] | ||
) { | ||
super(range); | ||
this.document = document; | ||
this.fileName = fileName; | ||
this.testName = testName; | ||
this.testIds = testIds; | ||
} | ||
} |
This file contains 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 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { DebugCodeLensProvider } from './DebugCodeLensProvider'; | ||
export { TestState } from './TestState'; | ||
export { DebugTestIdentifier } from './DebugCodeLens'; |
This file contains 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 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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
export type TestReconciliationState = 'Unknown' | 'KnownSuccess' | 'KnownFail' | 'KnownSkip'; | ||
export type TestReconciliationStateType = 'Unknown' | 'KnownSuccess' | 'KnownFail' | 'KnownSkip'; | ||
|
||
// tslint:disable-next-line variable-name | ||
export const TestReconciliationState = { | ||
Unknown: 'Unknown' as TestReconciliationState, | ||
KnownSuccess: 'KnownSuccess' as TestReconciliationState, | ||
KnownFail: 'KnownFail' as TestReconciliationState, | ||
KnownSkip: 'KnownSkip' as TestReconciliationState, | ||
export const TestReconciliationState: { | ||
[key in TestReconciliationStateType]: TestReconciliationStateType; | ||
} = { | ||
Unknown: 'Unknown', | ||
KnownSuccess: 'KnownSuccess', | ||
KnownFail: 'KnownFail', | ||
KnownSkip: 'KnownSkip', | ||
}; |
This file contains 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 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
Oops, something went wrong.