Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 90fd5ec

Browse files
committed
Add tests for the --watch option when there are errors
1 parent a410eb7 commit 90fd5ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/cli.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,13 @@ test("cli", function(t) {
111111
})
112112
planned+=2
113113

114+
var childProcess = exec(cssnextBin + " --watch test/fixtures/cli.error.css test/fixtures/cli.output--watch.css", function(err, stdout, stderr) {
115+
t.ok(utils.contains(stderr, "encounters an error"), "should output error messages when `--watch` option passed")
116+
t.ok(err && err.signal === "SIGTERM", "should only be killed by an interrupt when `--watch` option passed")
117+
if (err && !err.killed) { throw err }
118+
})
119+
setTimeout(function() { childProcess.kill("SIGTERM") }, 2000)
120+
planned+=2
121+
114122
t.plan(planned)
115123
})

0 commit comments

Comments
 (0)