Skip to content

Commit

Permalink
test (linux): fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelzhang committed Nov 25, 2024
1 parent 1317fac commit 46ed734
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ module.exports = (
t.is(result_no_f.stdout, '', 'stdout should be empty')

t.true(
result_no_f.stderr.includes(`: ${filepath}: No such file or directory`), `stderr should include "No such file or directory": ${
// The stderr of different rm distributions may vary:
// - Linux rm: "rm: cannot remove 'nonexistent.txt': No such file or directory"
// - Mac rm: "rm: nonexistent.txt: No such file or directory"
// So we just check if the stderr includes "No such file or directory"
result_no_f.stderr.includes('No such file or directory'), `stderr should include "No such file or directory": ${
result_no_f.stderr
}`)
})
Expand Down

0 comments on commit 46ed734

Please sign in to comment.