Skip to content

Commit

Permalink
Add registry setting to test env
Browse files Browse the repository at this point in the history
  • Loading branch information
kubouch committed Jan 28, 2024
1 parent 0ab10c5 commit 7d28528
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ def with-test-env [closure: closure]: nothing -> nothing {
let home = tmp-dir nupm_test --ensure
let cache = tmp-dir 'nupm_test/cache' --ensure
let temp = tmp-dir 'nupm_test/temp' --ensure
let reg = { test: $TEST_REGISTRY_PATH }

with-env {
NUPM_HOME: $home
NUPM_CACHE: $cache
NUPM_TEMP: $temp
NUPM_REGISTRIES: $reg
} $closure

rm --recursive $temp
Expand Down Expand Up @@ -69,21 +71,18 @@ export def install-from-local-registry [] {
}

with-test-env {
$env.NUPM_REGISTRIES = { test: $TEST_REGISTRY_PATH }
nupm install --registry test spam_script
check-file
}

with-test-env {
$env.NUPM_REGISTRIES = { test: $TEST_REGISTRY_PATH }
nupm install spam_script
check-file
}
}

export def search-registry [] {
with-test-env {
$env.NUPM_REGISTRIES = { test: $TEST_REGISTRY_PATH }
assert ((nupm search spam | get pkgs.0 | length) == 4)
}
}

0 comments on commit 7d28528

Please sign in to comment.