Skip to content

Commit

Permalink
stdlib: Add back recursive lookup for tests (nushell#8632)
Browse files Browse the repository at this point in the history
@amtoine during the refactor the test runner lost the ability for
looking up for test modules in subdirectories. I just added it back now.
  • Loading branch information
presidento authored and WindSoilder committed Mar 29, 2023
1 parent 2124f16 commit cbb4a81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/nu-utils/standard_library/tests.nu
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def main [
--command: string, # Test command to run. Default: all test command found in the files.
--list, # list the selected tests without running them.
] {
let module_search_pattern = ({
let module_search_pattern = ('**' | path join ({
stem: ($module | default "test_*")
extension: nu
} | path join)
} | path join))

if not ($path | is-empty) {
if not ($path | path exists) {
Expand All @@ -58,7 +58,7 @@ def main [
let path = ($path | default $env.FILE_PWD)

if not ($module | is-empty) {
if not ($path | path join $module_search_pattern | path exists) {
try { ls ($path | path join $module_search_pattern) | null } catch {
throw-error {
msg: "module_not_found"
label: $"no such module in ($path)"
Expand Down

0 comments on commit cbb4a81

Please sign in to comment.