Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jun 13, 2021
1 parent 36e99ab commit b060153
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -101,6 +101,34 @@ import json from "./foo.json" assert { type: "json", type: "bar" };
================================================================================
`;

exports[`non-type.js [espree] format 1`] = `
"Unexpected token assert (1:28)
> 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" };
| ^
2 |"
`;

exports[`non-type.js [meriyah] format 1`] = `
"[1:33]: Unexpected token: 'identifier' (1:33)
> 1 | import foo from \\"foo.json\\" assert { lazy: \\"true\\" };
| ^
2 |"
`;

exports[`non-type.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
printWidth: 80
| printWidth
=====================================input======================================
import foo from "foo.json" assert { lazy: "true" };
=====================================output=====================================
import foo from "foo.json" assert { lazy: "true" };
================================================================================
`;

exports[`not-import-assertions.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
Expand Down
2 changes: 2 additions & 0 deletions tests/format/js/import-assertions/jsfmt.spec.js
Expand Up @@ -7,6 +7,7 @@ run_spec(__dirname, ["babel"], {
"static-import.js",
"re-export.js",
"without-from.js",
"non-type.js",
],
meriyah: [
"dynamic-import.js",
Expand All @@ -15,6 +16,7 @@ run_spec(__dirname, ["babel"], {
"static-import.js",
"re-export.js",
"without-from.js",
"non-type.js",
],
},
});
1 change: 1 addition & 0 deletions tests/format/js/import-assertions/non-type.js
@@ -0,0 +1 @@
import foo from "foo.json" assert { lazy: "true" };

0 comments on commit b060153

Please sign in to comment.