Closed geelen closed 3 years ago
This adds the exits block to a shellac block:
exits
await shellac` exits { $ echo "this gon fail" >&2; false } stderr >> ${(stderr) => expect(stderr).toBe('this gon fail')} exitcode >> ${(exitcode) => expect(exitcode).toBe(1)} `
Since you often want to verify a particular exitcode, the exits(num) callback is given:
exits(num)
await shellac` exits(1) { $ echo "this gon fail" >&2; false } stderr >> ${(stderr) => expect(stderr).toBe('this gon fail')} `
Within an exits block, every line is expected to error (with the specific code, if given).
This adds the
exits
block to a shellac block:Since you often want to verify a particular exitcode, the
exits(num)
callback is given:Within an
exits
block, every line is expected to error (with the specific code, if given).