From 1a2216dcabbf58e055aaeac82ffe6f01e705034f Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Fri, 6 Nov 2020 11:02:39 +0900 Subject: [PATCH] Add tests for babel/babel#12281 --- .../__snapshots__/jsfmt.spec.js.snap | 14 ++++++++++++++ .../import-assertions-without-from.js | 1 + tests/js/import-assertions/jsfmt.spec.js | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 tests/js/import-assertions/import-assertions-without-from.js diff --git a/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap b/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap index df01ffc7403d..4ea0898ac071 100644 --- a/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap @@ -42,6 +42,20 @@ import json from "./foo.json" assert { type: "json" }; ================================================================================ `; +exports[`import-assertions-without-from.js format 1`] = ` +====================================options===================================== +parsers: ["babel"] +printWidth: 80 + | printWidth +=====================================input====================================== +import "foo" assert { type: "json" } + +=====================================output===================================== +import "foo" assert { type: "json" }; + +================================================================================ +`; + exports[`not-import-assertions.js format 1`] = ` ====================================options===================================== parsers: ["babel"] diff --git a/tests/js/import-assertions/import-assertions-without-from.js b/tests/js/import-assertions/import-assertions-without-from.js new file mode 100644 index 000000000000..daf38156ebb5 --- /dev/null +++ b/tests/js/import-assertions/import-assertions-without-from.js @@ -0,0 +1 @@ +import "foo" assert { type: "json" } diff --git a/tests/js/import-assertions/jsfmt.spec.js b/tests/js/import-assertions/jsfmt.spec.js index 7599ddea9386..9430e1f1a4d7 100644 --- a/tests/js/import-assertions/jsfmt.spec.js +++ b/tests/js/import-assertions/jsfmt.spec.js @@ -4,11 +4,13 @@ run_spec(__dirname, ["babel"], { "import-assertions-dynamic.js", "import-assertions-multi-types.js", "import-assertions-static.js", + "import-assertions-without-from.js", ], meriyah: [ "import-assertions-dynamic.js", "import-assertions-multi-types.js", "import-assertions-static.js", + "import-assertions-without-from.js", ], }, });