tasks: make error a json

also, handle case where we never got to handle task exit cleanly
This commit is contained in:
Girish Ramakrishnan
2019-08-30 13:46:55 -07:00
parent dd0fb8292c
commit bd23abd265
6 changed files with 57 additions and 21 deletions

View File

@@ -66,7 +66,7 @@ describe('Tasks API', function () {
expect(res.body.active).to.be(false); // finished
expect(res.body.success).to.be(true);
expect(res.body.result).to.be('ping');
expect(res.body.errorMessage).to.be(null);
expect(res.body.error).to.be(null);
done();
});
});
@@ -117,7 +117,7 @@ describe('Tasks API', function () {
expect(res.body.active).to.be(false); // finished
expect(res.body.success).to.be(false);
expect(res.body.result).to.be(null);
expect(res.body.errorMessage).to.contain('signal SIGTERM');
expect(res.body.error.message).to.contain('signal SIGTERM');
done();
});
});
@@ -148,7 +148,7 @@ describe('Tasks API', function () {
expect(res.body.tasks[0].active).to.be(false); // finished
expect(res.body.tasks[0].success).to.be(true); // finished
expect(res.body.tasks[0].result).to.be('ping');
expect(res.body.tasks[0].errorMessage).to.be(null);
expect(res.body.tasks[0].error).to.be(null);
done();
});
});