Closed reggi closed 8 years ago
npm's default test expression breaks too.
it('should return exit code 1', function (done) {
return nixt()
.run('echo \"Error: no test specified\" && exit 1')
.code(0)
.end(done)
})
Also can't run exit
.
it('should return exit 1', function (done) {
return nixt()
.run('exit 1')
.code(0)
.end(done)
})
Uncaught Error: spawn exit ENOENT
lmk if you wanna try to investigate & provide a patch, happy to give contributor/npm access
@reggi &&
and exit
aren't actually supposed to work.
nixt
uses child_process.spawn to spawn a process, not child_process.exec. The difference between the two is that spawn simply starts a new process with the given arguments, and exec spawns a shell process (/bin/sh
or cmd.exe
) and passes the command to that shell. The latter is substantially different, because the shell language usually includes many things such as sequencing operators (e.g. &&
and ||
), stdio redirection, loops and conditionals, built-in commands (e.g. exit
) and so on.
Do you still need to be able to use shell operators or builtins with nixt
? If so, what is your use case?
Closing due to lack of response.
This assertion does not work as expected, it throws an error.