summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/run_tests.rs10
-rw-r--r--tests/specs/future/import_assertions/__test__.jsonc16
-rw-r--r--tests/specs/future/import_assertions/error.out4
-rw-r--r--tests/specs/future/import_assertions/main.js2
-rw-r--r--tests/specs/future/import_assertions/main.json3
-rw-r--r--tests/specs/future/import_assertions/success.out1
-rw-r--r--tests/testdata/npm/import_json/main.js2
-rw-r--r--tests/testdata/run/deno_futures_env.ts3
-rw-r--r--tests/testdata/subdir/mod7.js2
-rw-r--r--tests/testdata/subdir/mod8.js2
10 files changed, 29 insertions, 16 deletions
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs
index e28251b23..e92fd3627 100644
--- a/tests/integration/run_tests.rs
+++ b/tests/integration/run_tests.rs
@@ -1694,16 +1694,6 @@ fn type_directives_js_main() {
assert_not_contains!(output.combined_output(), "type_reference.d.ts");
}
-#[test]
-fn test_deno_futures_env() {
- let context = TestContextBuilder::new().add_future_env_vars().build();
- let output = context
- .new_command()
- .args("run --quiet --reload run/deno_futures_env.ts")
- .run();
- output.assert_exit_code(0);
-}
-
itest!(type_directives_redirect {
args: "run --reload --check run/type_directives_redirect.ts",
output: "run/type_directives_redirect.ts.out",
diff --git a/tests/specs/future/import_assertions/__test__.jsonc b/tests/specs/future/import_assertions/__test__.jsonc
new file mode 100644
index 000000000..a1e759c75
--- /dev/null
+++ b/tests/specs/future/import_assertions/__test__.jsonc
@@ -0,0 +1,16 @@
+{
+ "steps": [
+ {
+ "args": "run main.js",
+ "output": "error.out",
+ "exitCode": 1,
+ "envs": {
+ "DENO_FUTURE": "1"
+ }
+ },
+ {
+ "args": "run main.js",
+ "output": "success.out"
+ }
+ ]
+}
diff --git a/tests/specs/future/import_assertions/error.out b/tests/specs/future/import_assertions/error.out
new file mode 100644
index 000000000..cef663f35
--- /dev/null
+++ b/tests/specs/future/import_assertions/error.out
@@ -0,0 +1,4 @@
+error: Uncaught SyntaxError: Unexpected identifier 'assert'
+import foo from "./main.json" assert { type: "json" };
+ ^
+ at <anonymous> (file:///[WILDCARD]/main.js:[WILDCARD])
diff --git a/tests/specs/future/import_assertions/main.js b/tests/specs/future/import_assertions/main.js
new file mode 100644
index 000000000..9b4c4d036
--- /dev/null
+++ b/tests/specs/future/import_assertions/main.js
@@ -0,0 +1,2 @@
+import foo from "./main.json" assert { type: "json" };
+console.log(foo);
diff --git a/tests/specs/future/import_assertions/main.json b/tests/specs/future/import_assertions/main.json
new file mode 100644
index 000000000..abdd5202b
--- /dev/null
+++ b/tests/specs/future/import_assertions/main.json
@@ -0,0 +1,3 @@
+{
+ "foo": "foo"
+}
diff --git a/tests/specs/future/import_assertions/success.out b/tests/specs/future/import_assertions/success.out
new file mode 100644
index 000000000..70ec274d9
--- /dev/null
+++ b/tests/specs/future/import_assertions/success.out
@@ -0,0 +1 @@
+{ foo: "foo" }
diff --git a/tests/testdata/npm/import_json/main.js b/tests/testdata/npm/import_json/main.js
index b752bdef8..ac6cee9a8 100644
--- a/tests/testdata/npm/import_json/main.js
+++ b/tests/testdata/npm/import_json/main.js
@@ -1,4 +1,4 @@
-import json from "npm:@denotest/binary-package@1/package.json" assert {
+import json from "npm:@denotest/binary-package@1/package.json" with {
type: "json",
};
console.log(json);
diff --git a/tests/testdata/run/deno_futures_env.ts b/tests/testdata/run/deno_futures_env.ts
deleted file mode 100644
index 21f76e367..000000000
--- a/tests/testdata/run/deno_futures_env.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-if (typeof window !== "undefined") {
- throw new Error("Window global available");
-}
diff --git a/tests/testdata/subdir/mod7.js b/tests/testdata/subdir/mod7.js
index 2bd4b5eb7..e71ced92e 100644
--- a/tests/testdata/subdir/mod7.js
+++ b/tests/testdata/subdir/mod7.js
@@ -1,3 +1,3 @@
-import json1 from "./json_1.json" assert { type: "json" };
+import json1 from "./json_1.json" with { type: "json" };
console.log(json1);
diff --git a/tests/testdata/subdir/mod8.js b/tests/testdata/subdir/mod8.js
index 5bf7a49a8..ed41d992c 100644
--- a/tests/testdata/subdir/mod8.js
+++ b/tests/testdata/subdir/mod8.js
@@ -1,3 +1,3 @@
-import json3 from "./json_3.json" assert { type: "json" };
+import json3 from "./json_3.json" with { type: "json" };
console.log(json3);