-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Support more directives in file analyzer testing system (#1069)
**Description:** When comparing TSC to error, we took the error results from ACTUAL. In actual, the rules for each file were not applied properly, As a result, tests like strictNullCheck didn't work correctly. To fix this, we unified the env import code within the tests.
- Loading branch information
1 parent
a04f4b1
commit d5a01ed
Showing
6 changed files
with
29 additions
and
31 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
5 changes: 5 additions & 0 deletions
5
crates/stc_ts_file_analyzer/tests/tsc/rule/strictNullCheck.ts
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 @@ | ||
// @strictNullChecks: true | ||
// @declaration: true | ||
|
||
declare let a : string; | ||
a = "a" as string | undefined; |
8 changes: 8 additions & 0 deletions
8
crates/stc_ts_file_analyzer/tests/tsc/rule/strictNullCheck.tsc-errors.json
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 @@ | ||
[ | ||
{ | ||
"file": "tests/tsc/rule/strictNullCheck.ts", | ||
"line": 5, | ||
"col": 1, | ||
"code": 2322 | ||
} | ||
] |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...s/stc_ts_file_analyzer/tests/tsc/types/intersection/withUnionConstraint/1.tsc-errors.json
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 @@ | ||
[ | ||
{ | ||
"file": "tests/tsc/types/intersection/withUnionConstraint/1.ts", | ||
"line": 4, | ||
"col": 9, | ||
"code": 2322 | ||
} | ||
] |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ Stats { | |
required_error: 3502, | ||
matched_error: 6533, | ||
extra_error: 764, | ||
panic: 73, | ||
} |