Skip to content

Commit 3e0cd24

Browse files
committed
Update error test endpoint checks.
- The random endpoints used at "dog.ceo" changed their error output. - Need to update to use a local server for testing.
1 parent 352ef88 commit 3e0cd24

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

tests/10-client-api.spec.common.cjs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,20 @@ describe('http-client API', () => {
206206
}
207207
should.not.exist(response);
208208
should.exist(err);
209-
err.message.should.contain('No route found');
209+
err.message.should.contain('404 Not Found');
210210
should.exist(err.response);
211211
should.exist(err.response.status);
212212
should.exist(err.status);
213213
err.status.should.equal(404);
214-
should.exist(err.data);
215-
err.data.should.be.an('object');
216-
// these are API specific from the JSON body of the response
217-
err.data.should.have.keys(['status', 'message', 'code']);
218-
err.data.status.should.equal('error');
219-
err.data.message.should.contain('No route found');
220-
err.data.code.should.equal(404);
214+
// FIXME: update to use local test endpoint, dog.ceo changed its output.
215+
should.not.exist(err.data);
216+
//should.exist(err.data);
217+
//err.data.should.be.an('object');
218+
//// these are API specific from the JSON body of the response
219+
//err.data.should.have.keys(['status', 'message', 'code']);
220+
//err.data.status.should.equal('error');
221+
//err.data.message.should.contain('No route found');
222+
//err.data.code.should.equal(404);
221223
});
222224
it('handles a direct get not found error with JSON data', async () => {
223225
let err;
@@ -230,18 +232,20 @@ describe('http-client API', () => {
230232
}
231233
should.not.exist(response);
232234
should.exist(err);
233-
err.message.should.contain('No route found');
235+
err.message.should.contain('404 Not Found');
234236
should.exist(err.response);
235237
should.exist(err.response.status);
236238
should.exist(err.status);
237239
err.status.should.equal(404);
238-
should.exist(err.data);
239-
err.data.should.be.an('object');
240-
// these are API specific from the JSON body of the response
241-
err.data.should.have.keys(['status', 'message', 'code']);
242-
err.data.status.should.equal('error');
243-
err.data.message.should.contain('No route found');
244-
err.data.code.should.equal(404);
240+
// FIXME: update to use local test endpoint, dog.ceo changed its output.
241+
should.not.exist(err.data);
242+
//should.exist(err.data);
243+
//err.data.should.be.an('object');
244+
//// these are API specific from the JSON body of the response
245+
//err.data.should.have.keys(['status', 'message', 'code']);
246+
//err.data.status.should.equal('error');
247+
//err.data.message.should.contain('No route found');
248+
//err.data.code.should.equal(404);
245249
});
246250
if(isNode) {
247251
describe('Nodejs execution context', () => {

0 commit comments

Comments
 (0)