1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #421 from hindessm/fix-supertest-usage

Fix supertest usage to correctly throw errors.
This commit is contained in:
Nick O'Leary 2014-10-01 22:48:00 +01:00
commit 86d4179039
2 changed files with 15 additions and 3 deletions

View File

@ -100,7 +100,14 @@ describe('inject node', function() {
}); });
helper.request() helper.request()
.post('/inject/n1') .post('/inject/n1')
.expect(200).end(function() {}); .expect(200).end(function(err) {
if (err) {
return helper.clearFlows()
.then(function () {
done(err);
});
}
});
}); });
}); });

View File

@ -231,7 +231,8 @@ describe('debug node', function() {
n1.emit("input", {payload:"message 1"}); n1.emit("input", {payload:"message 1"});
helper.request() helper.request()
.post('/debug/n1/enable') .post('/debug/n1/enable')
.expect(200).end(function() { .expect(200).end(function(err) {
if (err) { return done(err); }
n1.emit("input", {payload:"message 2"}); n1.emit("input", {payload:"message 2"});
}); });
}, function(msg) { }, function(msg) {
@ -249,7 +250,11 @@ describe('debug node', function() {
websocket_test(function(close) { websocket_test(function(close) {
helper.request() helper.request()
.post('/debug/n1/disable') .post('/debug/n1/disable')
.expect(200).end(function() { .expect(201).end(function(err) {
if (err) {
close();
return done(err);
}
n1.emit("input", {payload:"message"}); n1.emit("input", {payload:"message"});
setTimeout(function() { setTimeout(function() {
close(); close();