mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 23:54:37 +00:00
chore: add upgrade prompt integration test (#21273)
1. Adds an upgrade prompt integration test. 1. Adds a test for when the upgrade check takes a long time in the repl.
This commit is contained in:
parent
bf42467e21
commit
eda3850f84
4 changed files with 86 additions and 1 deletions
|
@ -635,6 +635,9 @@ impl TestCommandBuilder {
|
|||
if !envs.contains_key("NPM_CONFIG_REGISTRY") {
|
||||
envs.insert("NPM_CONFIG_REGISTRY".to_string(), npm_registry_unset_url());
|
||||
}
|
||||
if !envs.contains_key("DENO_NO_UPDATE_CHECK") {
|
||||
envs.insert("DENO_NO_UPDATE_CHECK".to_string(), "1".to_string());
|
||||
}
|
||||
for key in &self.envs_remove {
|
||||
envs.remove(key);
|
||||
}
|
||||
|
|
|
@ -1273,6 +1273,24 @@ async fn main_server(
|
|||
.unwrap(),
|
||||
)
|
||||
}
|
||||
(&hyper::Method::GET, "/upgrade/sleep/release-latest.txt") => {
|
||||
tokio::time::sleep(Duration::from_secs(45)).await;
|
||||
return Ok(
|
||||
Response::builder()
|
||||
.status(StatusCode::OK)
|
||||
.body(Body::from("99999.99.99"))
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
(&hyper::Method::GET, "/release-latest.txt") => {
|
||||
return Ok(
|
||||
Response::builder()
|
||||
.status(StatusCode::OK)
|
||||
// use a deno version that will never happen
|
||||
.body(Body::from("99999.99.99"))
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
let mut file_path = testdata_path().to_path_buf();
|
||||
file_path.push(&req.uri().path()[1..].replace("%2f", "/"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue