@@ -200,7 +200,8 @@ describe('http-client API', () => {
200
200
let response ;
201
201
try {
202
202
response = await httpClient . get (
203
- 'https://dog.ceo/api/breeds/image/DOESNOTEXIST' ) ;
203
+ // FIXME: update to use local test endpoint to avoid output changes
204
+ 'https://httpstat.us/404' ) ;
204
205
} catch ( e ) {
205
206
err = e ;
206
207
}
@@ -211,22 +212,20 @@ describe('http-client API', () => {
211
212
should . exist ( err . response . status ) ;
212
213
should . exist ( err . status ) ;
213
214
err . status . 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);
215
+ should . exist ( err . data ) ;
216
+ err . data . should . be . an ( 'object' ) ;
217
+ // these are API specific from the JSON body of the response
218
+ err . data . should . have . keys ( [ 'code' , 'description' ] ) ;
219
+ err . data . code . should . equal ( 404 ) ;
220
+ err . data . description . should . equal ( 'Not Found' ) ;
223
221
} ) ;
224
222
it ( 'handles a direct get not found error with JSON data' , async ( ) => {
225
223
let err ;
226
224
let response ;
227
225
try {
228
226
response = await httpClient (
229
- 'https://dog.ceo/api/breeds/image/DOESNOTEXIST' ) ;
227
+ // FIXME: update to use local test endpoint to avoid output changes
228
+ 'https://httpstat.us/404' ) ;
230
229
} catch ( e ) {
231
230
err = e ;
232
231
}
@@ -237,15 +236,12 @@ describe('http-client API', () => {
237
236
should . exist ( err . response . status ) ;
238
237
should . exist ( err . status ) ;
239
238
err . status . 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);
239
+ should . exist ( err . data ) ;
240
+ err . data . should . be . an ( 'object' ) ;
241
+ // these are API specific from the JSON body of the response
242
+ err . data . should . have . keys ( [ 'code' , 'description' ] ) ;
243
+ err . data . code . should . equal ( 404 ) ;
244
+ err . data . description . should . equal ( 'Not Found' ) ;
249
245
} ) ;
250
246
if ( isNode ) {
251
247
describe ( 'Nodejs execution context' , ( ) => {
0 commit comments