test: avoid /dev/null in command tests#161
Open
han-dreamer wants to merge 1 commit into
Open
Conversation
TumCucTom
reviewed
Jun 2, 2026
There was a problem hiding this comment.
good call — /dev/null in test code is the kind of thing that works on the original author's machine and silently breaks Windows contributors. small and targeted, exactly the right scope.
if you want a follow-up: a mkdtemp-style helper exported from test/utils/ would let future test files that need a scratch dir stop reinventing the pattern. the per-file cleanup is fine for now though.
approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace hard-coded
/dev/nulltest fixtures with temporary files created at runtime.This makes the affected command tests portable across Windows and Unix-like environments.
Changes
file uploaddry-run output test.music generatevalidation test.process.stdout.writewithany.Why
/dev/nullis available on Unix-like systems but not on Windows. When running the test suite on Windows, these tests fail before reaching the intended assertions.Testing
npx tsc --noEmitnpx eslint test/commands/file/upload.test.ts test/commands/music/generate.test.tsnpx bun testResult: 354 pass, 0 fail
Notes
I also tried the local smoke compile with
npx bun build src/main.ts --compile --outfile dist/mmx-test, but Bun failed on this Windows environment withfailed to copy bun executable into temporary file: ENOENT. The full test suite and typecheck pass locally.