Skip to content

Commit

Permalink
fix(cli/download): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo authored and theduke committed Jun 12, 2024
1 parent 123ce8f commit 27066c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/cli/src/commands/package/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl PackageDownload {
let download_url = package
.distribution_v3
.pirita_download_url
.context("registry does provide a container download container download URL")?;
.context("registry did not provide a container download URL")?;

let ident = format!("{}@{}", full_name, package.version);
let filename = if let Some(ns) = &package.package.namespace {
Expand Down Expand Up @@ -284,9 +284,8 @@ impl PackageDownload {

#[cfg(test)]
mod tests {
use wasmer_registry::wasmer_env::WASMER_DIR;

use super::*;
use std::str::FromStr;

/// Download a package from the dev registry.
#[test]
Expand All @@ -296,9 +295,13 @@ mod tests {
let out_path = dir.path().join("hello.webc");

let cmd = PackageDownload {
env: WasmerEnv::new(WASMER_DIR.clone(), Some("wasmer.wtf".into()), None, None),
env: WasmerEnv::default(),
api: ApiOpts {
token: None,
registry: Some(url::Url::from_str("https://registry.wasmer.io/graphql").unwrap()),
},
validate: true,
out_path: out_path.clone(),
out_path: Some(out_path.clone()),
package: "wasmer/[email protected]".parse().unwrap(),
quiet: true,
};
Expand Down

0 comments on commit 27066c6

Please sign in to comment.