Skip to content

Commit 254d2e4

Browse files
authored
test(JsSourceParser): should not crash with source code containing import attributes (#322)
1 parent e7a5193 commit 254d2e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/JsSourceParser.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,13 @@ describe("JsSourceParser", () => {
2929
isEcmaScriptModule: false
3030
});
3131
});
32+
33+
it("should not crash with a source code containing import attributes", () => {
34+
const code = `import data from "./data.json" with { type: "json" };
35+
export default data;`;
36+
new JsSourceParser().parse(code, {
37+
isEcmaScriptModule: false
38+
});
39+
});
3240
});
3341
});

0 commit comments

Comments
 (0)