File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ async function fetch (...args) {
171171
172172 // 3. If response is a network error, then reject p with a TypeError
173173 // and terminate these substeps.
174- if ( response . status === 0 ) {
174+ if ( response . type === 'error' ) {
175175 p . reject (
176176 Object . assign ( new TypeError ( 'fetch failed' ) , { cause : response . error } )
177177 )
Original file line number Diff line number Diff line change @@ -409,14 +409,14 @@ describe('node-fetch', () => {
409409 } )
410410 } )
411411
412- xit ( 'should treat broken redirect as ordinary response (manual)' , ( ) => {
412+ it ( 'should treat broken redirect as ordinary response (manual)' , ( ) => {
413413 const url = `${ base } redirect/no-location`
414414 const options = {
415415 redirect : 'manual'
416416 }
417417 return fetch ( url , options ) . then ( res => {
418418 expect ( res . url ) . to . equal ( url )
419- expect ( res . status ) . to . equal ( 301 )
419+ expect ( res . status ) . to . equal ( 0 )
420420 expect ( res . headers . get ( 'location' ) ) . to . be . null
421421 } )
422422 } )
You can’t perform that action at this time.
0 commit comments