Skip to content

test: avoid /dev/null in command tests#161

Open
han-dreamer wants to merge 1 commit into
MiniMax-AI:mainfrom
han-dreamer:test/windows-temp-file-fixtures
Open

test: avoid /dev/null in command tests#161
han-dreamer wants to merge 1 commit into
MiniMax-AI:mainfrom
han-dreamer:test/windows-temp-file-fixtures

Conversation

@han-dreamer
Copy link
Copy Markdown

Summary

Replace hard-coded /dev/null test fixtures with temporary files created at runtime.

This makes the affected command tests portable across Windows and Unix-like environments.

Changes

  • Use a temporary fixture file in file upload dry-run output test.
  • Use a temporary lyrics file in music generate validation test.
  • Clean up temporary directories after each test.
  • Reuse a typed stdout capture helper instead of assigning process.stdout.write with any.

Why

/dev/null is 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 --noEmit
  • npx eslint test/commands/file/upload.test.ts test/commands/music/generate.test.ts
  • npx bun test
    Result: 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 with failed to copy bun executable into temporary file: ENOENT. The full test suite and typecheck pass locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant