diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-12-13 11:00:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-13 11:00:45 +0100 |
| commit | bbf8f69cb979be0f36c38ae52b1588e648b3252e (patch) | |
| tree | c6b8f727a1c99eb848248c0891d08eb72dc73b49 /cli/tests/integration | |
| parent | 86769b0d1cfb7341df31278913524492d5f9ab52 (diff) | |
test: integration tests for tarring/unfurling (#21544)
Diffstat (limited to 'cli/tests/integration')
| -rw-r--r-- | cli/tests/integration/mod.rs | 3 | ||||
| -rw-r--r-- | cli/tests/integration/publish_tests.rs | 38 |
2 files changed, 41 insertions, 0 deletions
diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index 80b316432..5c9a00ff2 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -132,6 +132,9 @@ mod node_compat_tests; mod node_unit_tests; #[path = "npm_tests.rs"] mod npm; +#[path = "publish_tests.rs"] +mod publish; + #[path = "repl_tests.rs"] mod repl; #[path = "run_tests.rs"] diff --git a/cli/tests/integration/publish_tests.rs b/cli/tests/integration/publish_tests.rs new file mode 100644 index 000000000..6a40eabf6 --- /dev/null +++ b/cli/tests/integration/publish_tests.rs @@ -0,0 +1,38 @@ +// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +static TEST_REGISTRY_URL: &str = "http://127.0.0.1:4250"; + +pub fn env_vars_for_registry() -> Vec<(String, String)> { + vec![ + ( + "DENO_REGISTRY_URL".to_string(), + TEST_REGISTRY_URL.to_string(), + ), + ( + "DENO_REGISTRY_API_URL".to_string(), + TEST_REGISTRY_URL.to_string(), + ), + ] +} + +itest!(no_token { + args: "do-not-use-publish publish/missing_deno_json", + output: "publish/no_token.out", + exit_code: 1, +}); + +itest!(missing_deno_json { + args: + "do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/missing_deno_json", + output: "publish/missing_deno_json.out", + exit_code: 1, + temp_cwd: true, +}); + +itest!(successful { + args: "do-not-use-publish --token 'sadfasdf' $TESTDATA/publish/successful", + output: "publish/successful.out", + envs: env_vars_for_registry(), + http_server: true, + temp_cwd: true, +}); |
