mirror of
https://github.com/denoland/deno
synced 2024-10-12 11:02:29 +00:00
fix(install): forward granular --unstable-* flags (#22164)
Closes https://github.com/denoland/deno/issues/22154
This commit is contained in:
parent
6512be458f
commit
cfb57b1855
|
@ -382,6 +382,10 @@ async fn resolve_shim_data(
|
||||||
executable_args.push("--unstable".to_string());
|
executable_args.push("--unstable".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for feature in &flags.unstable_config.features {
|
||||||
|
executable_args.push(format!("--unstable-{}", feature));
|
||||||
|
}
|
||||||
|
|
||||||
if flags.no_remote {
|
if flags.no_remote {
|
||||||
executable_args.push("--no-remote".to_string());
|
executable_args.push("--no-remote".to_string());
|
||||||
}
|
}
|
||||||
|
@ -706,6 +710,73 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn install_unstable_legacy() {
|
||||||
|
let shim_data = resolve_shim_data(
|
||||||
|
&Flags {
|
||||||
|
unstable_config: UnstableConfig {
|
||||||
|
legacy_flag_enabled: true,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
&InstallFlags {
|
||||||
|
module_url: "http://localhost:4545/echo_server.ts".to_string(),
|
||||||
|
args: vec![],
|
||||||
|
name: None,
|
||||||
|
root: Some(env::temp_dir().to_string_lossy().to_string()),
|
||||||
|
force: false,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert_eq!(shim_data.name, "echo_server");
|
||||||
|
assert_eq!(
|
||||||
|
shim_data.args,
|
||||||
|
vec![
|
||||||
|
"run",
|
||||||
|
"--unstable",
|
||||||
|
"--no-config",
|
||||||
|
"http://localhost:4545/echo_server.ts",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn install_unstable_features() {
|
||||||
|
let shim_data = resolve_shim_data(
|
||||||
|
&Flags {
|
||||||
|
unstable_config: UnstableConfig {
|
||||||
|
features: vec!["kv".to_string(), "cron".to_string()],
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
&InstallFlags {
|
||||||
|
module_url: "http://localhost:4545/echo_server.ts".to_string(),
|
||||||
|
args: vec![],
|
||||||
|
name: None,
|
||||||
|
root: Some(env::temp_dir().to_string_lossy().to_string()),
|
||||||
|
force: false,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert_eq!(shim_data.name, "echo_server");
|
||||||
|
assert_eq!(
|
||||||
|
shim_data.args,
|
||||||
|
vec![
|
||||||
|
"run",
|
||||||
|
"--unstable-kv",
|
||||||
|
"--unstable-cron",
|
||||||
|
"--no-config",
|
||||||
|
"http://localhost:4545/echo_server.ts",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn install_inferred_name_from_parent() {
|
async fn install_inferred_name_from_parent() {
|
||||||
let shim_data = resolve_shim_data(
|
let shim_data = resolve_shim_data(
|
||||||
|
|
Loading…
Reference in a new issue