tests: Bun fails to overwrite project files if CLI is executed with absolute path
sammoore opened this issue · comments
Node, and Bun (if the CLI is executed with relative paths), will happily overwrite files in the target directory -- but if you run the CLI with absolute paths (as the tests do), Bun sometimes (maybe depending on minor/patch version?) fails to overwrite the files with an error that the file already exists.
This has causes sporadic failures in CI, and particularly on my Linux machine I am unable to run the tests generally.
A possible fix is here to make the behavior the same as Node by using relative paths, once other test fixes are merged I will submit a PR.
@frankcalise has mentioned on Discord this issue, and while I do agree that we shouldn't silently overwrite files, I also think the tests should run as node and node's fs
module would run. A test and/or a separate fix for the better UX around not overwriting files should also happen.