2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-12-13 05:00:45 -05:00
|
|
|
|
|
|
|
static TEST_REGISTRY_URL: &str = "http://127.0.0.1:4250";
|
|
|
|
|
|
|
|
pub fn env_vars_for_registry() -> Vec<(String, String)> {
|
2023-12-15 05:27:10 -05:00
|
|
|
vec![(
|
|
|
|
"DENO_REGISTRY_URL".to_string(),
|
|
|
|
TEST_REGISTRY_URL.to_string(),
|
|
|
|
)]
|
2023-12-13 05:00:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
itest!(no_token {
|
2024-01-08 15:07:36 -05:00
|
|
|
args: "publish publish/missing_deno_json",
|
2023-12-13 05:00:45 -05:00
|
|
|
output: "publish/no_token.out",
|
|
|
|
exit_code: 1,
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(missing_deno_json {
|
2024-01-08 15:07:36 -05:00
|
|
|
args: "publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json",
|
2023-12-13 05:00:45 -05:00
|
|
|
output: "publish/missing_deno_json.out",
|
|
|
|
exit_code: 1,
|
|
|
|
temp_cwd: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(successful {
|
2024-01-08 15:07:36 -05:00
|
|
|
args: "publish --token 'sadfasdf' $TESTDATA/publish/successful",
|
2023-12-13 05:00:45 -05:00
|
|
|
output: "publish/successful.out",
|
|
|
|
envs: env_vars_for_registry(),
|
|
|
|
http_server: true,
|
|
|
|
temp_cwd: true,
|
|
|
|
});
|