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:
Cornelius Riemenschneider
2024-08-28 10:41:53 +02:00
parent 22e1921391
commit b7b475d13b
13 changed files with 0 additions and 3 deletions

View File

@@ -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
}
}

View File

@@ -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>;

View File

@@ -0,0 +1,2 @@
def test(codeql, javascript):
codeql.database.create(_assert_failure=True)

View File

@@ -0,0 +1 @@
4 %%% 5

View File

@@ -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
}
}

View File

@@ -0,0 +1,2 @@
def test(codeql, javascript):
codeql.database.create()