Skip to content

Commit a1c1f7b

Browse files
committed
Add tests for deprecated 'assert' syntax
1 parent f38d2e1 commit a1c1f7b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

javascript/ql/test/library-tests/TypeScript/ImportAssertions/js-import-assertions.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,14 @@ const v6 = import("module", { with: { type: "json" } });
1111

1212
import "module" // missing semicolon
1313
assert({type: "json"}); // function call, not import assertion
14+
15+
import "module" assert { type: "json" };
16+
import * as v1 from "module" assert { type: "json" };
17+
import { v2 } from "module" assert { type: "json" };
18+
import v3 from "module" assert { type: "json" };
19+
20+
export { v7 } from "module" assert { type: "json" };
21+
export * from "module" assert { type: "json" };
22+
export * as v5 from "module" assert { type: "json" };
23+
24+
const v6 = import("module", { assert: { type: "json" } });

javascript/ql/test/library-tests/TypeScript/ImportAssertions/test.expected

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ getImportAttributesFromImport
33
| js-import-assertions.js:2:1:2:51 | import ... son" }; | js-import-assertions.js:2:35:2:50 | { type: "json" } |
44
| js-import-assertions.js:3:1:3:50 | import ... son" }; | js-import-assertions.js:3:34:3:49 | { type: "json" } |
55
| js-import-assertions.js:4:1:4:46 | import ... son" }; | js-import-assertions.js:4:30:4:45 | { type: "json" } |
6+
| js-import-assertions.js:15:1:15:40 | import ... son" }; | js-import-assertions.js:15:24:15:39 | { type: "json" } |
7+
| js-import-assertions.js:16:1:16:53 | import ... son" }; | js-import-assertions.js:16:37:16:52 | { type: "json" } |
8+
| js-import-assertions.js:17:1:17:52 | import ... son" }; | js-import-assertions.js:17:36:17:51 | { type: "json" } |
9+
| js-import-assertions.js:18:1:18:48 | import ... son" }; | js-import-assertions.js:18:32:18:47 | { type: "json" } |
610
| ts-import-assertions.ts:3:1:3:40 | import ... son" }; | ts-import-assertions.ts:3:24:3:39 | { type: "json" } |
711
| ts-import-assertions.ts:4:1:4:53 | import ... son" }; | ts-import-assertions.ts:4:37:4:52 | { type: "json" } |
812
| ts-import-assertions.ts:5:1:5:52 | import ... son" }; | ts-import-assertions.ts:5:36:5:51 | { type: "json" } |
@@ -11,10 +15,14 @@ getImportAttributesFromExport
1115
| js-import-assertions.js:6:1:6:50 | export ... son" }; | js-import-assertions.js:6:34:6:49 | { type: "json" } |
1216
| js-import-assertions.js:7:1:7:45 | export ... son" }; | js-import-assertions.js:7:29:7:44 | { type: "json" } |
1317
| js-import-assertions.js:8:1:8:51 | export ... son" }; | js-import-assertions.js:8:35:8:50 | { type: "json" } |
18+
| js-import-assertions.js:20:1:20:52 | export ... son" }; | js-import-assertions.js:20:36:20:51 | { type: "json" } |
19+
| js-import-assertions.js:21:1:21:47 | export ... son" }; | js-import-assertions.js:21:31:21:46 | { type: "json" } |
20+
| js-import-assertions.js:22:1:22:53 | export ... son" }; | js-import-assertions.js:22:37:22:52 | { type: "json" } |
1421
| ts-import-assertions.ts:8:1:8:52 | export ... son" }; | ts-import-assertions.ts:8:36:8:51 | { type: "json" } |
1522
| ts-import-assertions.ts:9:1:9:47 | export ... son" }; | ts-import-assertions.ts:9:31:9:46 | { type: "json" } |
1623
| ts-import-assertions.ts:10:1:10:53 | export ... son" }; | ts-import-assertions.ts:10:37:10:52 | { type: "json" } |
1724
getImportAttributes
1825
| js-import-assertions.js:10:12:10:55 | import( ... n" } }) | js-import-assertions.js:10:29:10:54 | { with: ... on" } } |
26+
| js-import-assertions.js:24:12:24:57 | import( ... n" } }) | js-import-assertions.js:24:29:24:56 | { asser ... on" } } |
1927
| ts-import-assertions.ts:12:12:12:57 | import( ... n" } }) | ts-import-assertions.ts:12:29:12:56 | { asser ... on" } } |
2028
errors

0 commit comments

Comments
 (0)