diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-03-08 00:32:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 01:32:11 +0100 |
commit | 2ed984ba3aa638c3f088ac1edc5c779c7d9195d1 (patch) | |
tree | 2240b8833d01f26109c140b295c1c297a3ef3461 /tests/integration/compile_tests.rs | |
parent | 2d5b19277b483de64087822934d42fc3e09c1c24 (diff) |
fix: respect unstable "temporal" configuration in config file (#22134)
Actual fix happened in https://github.com/denoland/deno/pull/22782, but
this commit adds additional tests and cleans up V8 flags passed on init.
Closes https://github.com/denoland/deno/issues/22123
Closes https://github.com/denoland/deno/issues/22560
Closes https://github.com/denoland/deno/issues/22557
Diffstat (limited to 'tests/integration/compile_tests.rs')
-rw-r--r-- | tests/integration/compile_tests.rs | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index b038819a7..9258da89f 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use deno_core::serde_json; use test_util as util; use util::assert_contains; use util::assert_not_contains; @@ -1140,6 +1141,7 @@ fn granular_unstable_features() { "--output", &exe.to_string_lossy(), "--unstable-kv", + "--unstable-temporal", "./compile/unstable_features.ts", ]) .run(); @@ -1147,7 +1149,41 @@ fn granular_unstable_features() { output.skip_output_check(); let output = context.new_command().name(&exe).run(); output.assert_exit_code(0); - output.assert_matches_text("Kv {}\n"); + output.assert_matches_text("Kv {}\nObject [Temporal] {}\n"); +} + +#[test] +fn granular_unstable_features_config_file() { + let context = TestContextBuilder::new().build(); + let dir = context.temp_dir(); + let exe = if cfg!(windows) { + dir.path().join("app.exe") + } else { + dir.path().join("app") + }; + dir.write( + "deno.json", + serde_json::to_string_pretty(&serde_json::json!({ + "unstable": ["kv", "temporal"] + })) + .unwrap(), + ); + let output = context + .new_command() + .args_vec([ + "compile", + "--config", + &dir.path().join("deno.json").to_string(), + "--output", + &exe.to_string_lossy(), + "./compile/unstable_features.ts", + ]) + .run(); + output.assert_exit_code(0); + output.skip_output_check(); + let output = context.new_command().name(&exe).run(); + output.assert_exit_code(0); + output.assert_matches_text("Kv {}\nObject [Temporal] {}\n"); } #[test] |