←back to thread

167 points jgrahamc | 3 comments | | HN request time: 0s | source
Show context
bouke ◴[] No.43557162[source]
So the real problem is that Jest just executes to whatever `sl` resolves. The fix they intent to release doesn't address that, but it tries to recognise the train steaming through. How is this acceptable behaviour from a test runner, as it looks like a disaster to happen. What if I have `alias sl=rm -rf /`, as one typically wants to have such a command close at hand?
replies(4): >>43557349 #>>43557468 #>>43557711 #>>43558209 #
blueflow ◴[] No.43557468[source]
What else should the test runner do?
replies(2): >>43557612 #>>43557677 #
pasc1878 ◴[] No.43557612[source]
Use the full path of sl and not rely on $PATH in the same way cron and macOS GUI apps do for I assume this exact reason.
replies(4): >>43557887 #>>43558500 #>>43558696 #>>43560502 #
1. stonegray ◴[] No.43557887[source]
Is the full path guaranteed? For example homebrew, snap, and apt might put it all in different places. $PATH is a useful tool.
replies(2): >>43558585 #>>43559161 #
2. ◴[] No.43558585[source]
3. pasc1878 ◴[] No.43559161[source]
But not in this case where you have two executables with the same name.

You have to know where the tool was installed or else be certain no other sl is on your path.