-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): proper type checking for files with doc tests (#23654)
Closes #23430 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
- Loading branch information
Showing
4 changed files
with
37 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"args": "test --doc main.ts", | ||
"output": "main.out", | ||
"exitCode": 1 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Check [WILDCARD]/main.ts | ||
Check [WILDCARD]/main.ts$2-5.ts | ||
error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. | ||
const a: string = 1; | ||
^ | ||
at file://[WILDCARD]/main.ts:8:7 | ||
|
||
TS2322 [ERROR]: Type 'string' is not assignable to type 'number'. | ||
const b: number = "1"; | ||
^ | ||
at file://[WILDCARD]/main.ts$2-5.ts:1:7 | ||
|
||
Found 2 errors. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* ```ts | ||
* const b: number = "1"; | ||
* ``` | ||
*/ | ||
function foo() {} | ||
|
||
const a: string = 1; |