Skip to content

Commit

Permalink
Test(main): config.timeout is ‘request failed’
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Nov 28, 2016
1 parent bddf57e commit c12a0fa
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,6 @@ dotest.add ('Module', function (test) {
});


dotest.add ('config.timeout', function (test) {
ovio ({
path: '4-TFL-24',
params: {
fields: ['eerstekleur']
},
timeout: 1,
callback: function (err) {
var error = err && err.error;

test()
.isError ('fail', 'err', err)
.isExactly ('fail', 'err.message', err && err.message, 'request failed')
.isError ('fail', 'err.error', error)
.isExactly ('fail', 'err.error.code', error && error.code, 'TIMEOUT')
.done();
}
});
});


dotest.add ('no result', function (test) {
ovio ({
path: 'error.test',
Expand Down Expand Up @@ -105,6 +84,28 @@ dotest.add ('list', function (test) {
});


dotest.add ('Error: request failed', function (test) {
ovio ({
path: '4-TFL-24',
params: {
fields: ['eerstekleur']
},
timeout: 1,
callback: function (err, data) {
var error = err && err.error;

test()
.isError ('fail', 'err', err)
.isExactly ('fail', 'err.message', err && err.message, 'request failed')
.isError ('fail', 'err.error', error)
.isExactly ('fail', 'err.error.code', error && error.code, 'TIMEOUT')
.isUndefined ('fail', 'data', data)
.done();
}
});
});


dotest.add ('Error: invalid response', function (test) {
ovio ({
params: {
Expand Down

0 comments on commit c12a0fa

Please sign in to comment.