mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
JS: Move all integration tests.
We no longer need the platform-specific directories, so simplify the test organization. If you don't want this change, just skip merging this PR. It's purely optional. The PR also deletes a spurious qlpack.yml that I missed when converting the tests to pytest.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"markdownMessage": "Internal error: com.semmle.util.exception.CatastrophicError: The TypeScript parser wrapper crashed with exit code 1",
|
||||
"severity": "unknown",
|
||||
"source": {
|
||||
"extractorName": "javascript",
|
||||
"id": "js/internal-error",
|
||||
"name": "Internal error"
|
||||
},
|
||||
"visibility": {
|
||||
"cliSummaryTable": true,
|
||||
"statusPage": false,
|
||||
"telemetry": true
|
||||
}
|
||||
}
|
||||
@@ -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>;
|
||||
@@ -0,0 +1,2 @@
|
||||
def test(codeql, javascript):
|
||||
codeql.database.create(_assert_failure=True)
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
4 %%% 5
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"location": {
|
||||
"endColumn": 5,
|
||||
"endLine": 1,
|
||||
"file": "bad.js",
|
||||
"startColumn": 5,
|
||||
"startLine": 1
|
||||
},
|
||||
"markdownMessage": "A parse error occurred: `Unexpected token`. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.",
|
||||
"severity": "warning",
|
||||
"source": {
|
||||
"extractorName": "javascript",
|
||||
"id": "js/parse-error",
|
||||
"name": "Could not process some files due to syntax errors"
|
||||
},
|
||||
"visibility": {
|
||||
"cliSummaryTable": true,
|
||||
"statusPage": true,
|
||||
"telemetry": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
def test(codeql, javascript):
|
||||
codeql.database.create()
|
||||
Reference in New Issue
Block a user