Skip to content

Commit 4192d09

Browse files
committed
Add tests for deprecated 'assert' syntax
1 parent b4d89f7 commit 4192d09

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ getImportAttributesFromImport
1111
| ts-import-assertions.ts:4:1:4:51 | import ... son" }; | ts-import-assertions.ts:4:35:4:50 | { type: "json" } |
1212
| ts-import-assertions.ts:5:1:5:50 | import ... son" }; | ts-import-assertions.ts:5:34:5:49 | { type: "json" } |
1313
| ts-import-assertions.ts:6:1:6:46 | import ... son" }; | ts-import-assertions.ts:6:30:6:45 | { type: "json" } |
14+
| ts-import-assertions.ts:17:1:17:40 | import ... son" }; | ts-import-assertions.ts:17:24:17:39 | { type: "json" } |
15+
| ts-import-assertions.ts:18:1:18:53 | import ... son" }; | ts-import-assertions.ts:18:37:18:52 | { type: "json" } |
16+
| ts-import-assertions.ts:19:1:19:52 | import ... son" }; | ts-import-assertions.ts:19:36:19:51 | { type: "json" } |
17+
| ts-import-assertions.ts:20:1:20:48 | import ... son" }; | ts-import-assertions.ts:20:32:20:47 | { type: "json" } |
1418
getImportAttributesFromExport
1519
| js-import-assertions.js:6:1:6:50 | export ... son" }; | js-import-assertions.js:6:34:6:49 | { type: "json" } |
1620
| js-import-assertions.js:7:1:7:45 | export ... son" }; | js-import-assertions.js:7:29:7:44 | { type: "json" } |
@@ -21,8 +25,12 @@ getImportAttributesFromExport
2125
| ts-import-assertions.ts:8:1:8:50 | export ... son" }; | ts-import-assertions.ts:8:34:8:49 | { type: "json" } |
2226
| ts-import-assertions.ts:9:1:9:45 | export ... son" }; | ts-import-assertions.ts:9:29:9:44 | { type: "json" } |
2327
| ts-import-assertions.ts:10:1:10:51 | export ... son" }; | ts-import-assertions.ts:10:35:10:50 | { type: "json" } |
28+
| ts-import-assertions.ts:22:1:22:52 | export ... son" }; | ts-import-assertions.ts:22:36:22:51 | { type: "json" } |
29+
| ts-import-assertions.ts:23:1:23:47 | export ... son" }; | ts-import-assertions.ts:23:31:23:46 | { type: "json" } |
30+
| ts-import-assertions.ts:24:1:24:53 | export ... son" }; | ts-import-assertions.ts:24:37:24:52 | { type: "json" } |
2431
getImportOptions
2532
| js-import-assertions.js:10:12:10:55 | import( ... n" } }) | js-import-assertions.js:10:29:10:54 | { with: ... on" } } |
2633
| js-import-assertions.js:24:12:24:57 | import( ... n" } }) | js-import-assertions.js:24:29:24:56 | { asser ... on" } } |
2734
| ts-import-assertions.ts:12:12:12:55 | import( ... n" } }) | ts-import-assertions.ts:12:29:12:54 | { with: ... on" } } |
35+
| ts-import-assertions.ts:26:12:26:57 | import( ... n" } }) | ts-import-assertions.ts:26:29:26:56 | { asser ... on" } } |
2836
errors

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

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

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

0 commit comments

Comments
 (0)