From f4284b91ea4c9fde9ecd72a866196546eaf0d9e2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jul 2015 17:23:59 -0700 Subject: [PATCH] Add failing spec for missing stdout/stderr --- spec/task-spec.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/task-spec.coffee b/spec/task-spec.coffee index 947db5567..3c5314c80 100644 --- a/spec/task-spec.coffee +++ b/spec/task-spec.coffee @@ -71,6 +71,17 @@ describe "Task", -> expect(stdout.listeners('data').length).toBe 0 expect(stderr.listeners('data').length).toBe 0 + task = new Task(require.resolve('./fixtures/task-spec-handler')) + task.start() + + # Sometimes process don't have stdout/stderr + task.childProcess.stdout = null + task.childProcess.stderr = null + + task.terminate() + + expect(-> task.terminate()).not.toThrow() + describe "::cancel()", -> it "dispatches 'task:cancelled' when invoked on an active task", -> task = new Task(require.resolve('./fixtures/task-spec-handler'))