forked from github/codeql
-
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.
add test diagnostics test for internal error
- Loading branch information
1 parent
07f8780
commit 27c2930
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...script/ql/integration-tests/all-platforms/diagnostics/internal-error/diagnostics.expected
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,15 @@ | ||
{ | ||
"timestamp": "2023-03-23T12:04:41.317+00:00", | ||
"source": { | ||
"id": "js/internal-error", | ||
"name": "Internal error", | ||
"extractorName": "javascript" | ||
}, | ||
"markdownMessage": "Internal error: com.semmle.util.exception.CatastrophicError: The TypeScript parser wrapper crashed with exit code 1", | ||
"severity": "unknown", | ||
"visibility": { | ||
"cliSummaryTable": true, | ||
"statusPage": false, | ||
"telemetry": true | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
javascript/ql/integration-tests/all-platforms/diagnostics/internal-error/src/my_failure.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,17 @@ | ||
type Output<K, S extends any[]> = { | ||
(...args: S): any; | ||
}; | ||
|
||
declare function createThing<K extends string, S extends any[]>( | ||
type: K, | ||
fn: (...args: S) => any | ||
): Output<K, S>; | ||
|
||
const one = createThing("one", () => ({})); | ||
|
||
const two = createThing("two", () => ({})); | ||
|
||
const three = createThing("three", (cursor: string) => null); | ||
const four = createThing("four", (error: number) => null); | ||
|
||
type Events = Array<typeof one | typeof two | typeof three | typeof four>; |
7 changes: 7 additions & 0 deletions
7
javascript/ql/integration-tests/all-platforms/diagnostics/internal-error/test.py
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,7 @@ | ||
import os | ||
from create_database_utils import * | ||
from diagnostics_test_utils import * | ||
|
||
run_codeql_database_create([], lang="javascript", runFunction = runUnsuccessfully, db = None) | ||
|
||
check_diagnostics() |
1 change: 1 addition & 0 deletions
1
javascript/ql/integration-tests/all-platforms/diagnostics/internal-error/tsconfig.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 @@ | ||
{} |