mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 15:44:31 +03:00
5e9f9b4edd
Some of the runnables added in #12118 don't work for tests (or code) that contain spaces. In other words, the runnable for a test like ```js it('does the thing', () => ...) ``` would end up w/ something like `npx jest does the thing /path/to/file.spec.js`, but what we really want is `npx jest --testNamePattern "does the thing" /path/to/file.spec.js`. A similar thing was happening for the "node execute selection" runnable: selecting `let foo = 1` would run `node -e let foo = 1`, not `node -e "let foo = 1"`. In my (somewhat limited?) experience, it's very common for tests like these to include spaces, and of course a code selection is almost certain to contain whitespace. Not covered: - this just blindly wraps quotes around the symbol/code; in the future it may make sense to try to figure out *what type of quote* to use. (eg `it('does the "thing"', () => ...)` is a valid test name, but `--testNamePattern "does the "thing""` would not work. Note the doubled quotes.) - I did not wrap the filenames in quotes to escape those for the shell, nor did I test if that's actually an issue. In my experience, I've not seen many (any?) test files that contain spaces in the name, but I suspect that it would be an issue if a containing dir includes spaces. (eg `npx jest ... /path/to/My Documents/Code/file.spec.js` /cc @RemcoSmitsDev Release Notes: - Fixed some runnables in Javascript/Typescript |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |