Skip to content

Commit 27c2930

Browse files
committed
add test diagnostics test for internal error
1 parent 07f8780 commit 27c2930

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"timestamp": "2023-03-23T12:04:41.317+00:00",
3+
"source": {
4+
"id": "js/internal-error",
5+
"name": "Internal error",
6+
"extractorName": "javascript"
7+
},
8+
"markdownMessage": "Internal error: com.semmle.util.exception.CatastrophicError: The TypeScript parser wrapper crashed with exit code 1",
9+
"severity": "unknown",
10+
"visibility": {
11+
"cliSummaryTable": true,
12+
"statusPage": false,
13+
"telemetry": true
14+
}
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
type Output<K, S extends any[]> = {
2+
(...args: S): any;
3+
};
4+
5+
declare function createThing<K extends string, S extends any[]>(
6+
type: K,
7+
fn: (...args: S) => any
8+
): Output<K, S>;
9+
10+
const one = createThing("one", () => ({}));
11+
12+
const two = createThing("two", () => ({}));
13+
14+
const three = createThing("three", (cursor: string) => null);
15+
const four = createThing("four", (error: number) => null);
16+
17+
type Events = Array<typeof one | typeof two | typeof three | typeof four>;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
from create_database_utils import *
3+
from diagnostics_test_utils import *
4+
5+
run_codeql_database_create([], lang="javascript", runFunction = runUnsuccessfully, db = None)
6+
7+
check_diagnostics()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)