Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 29 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import fetch from 'node-fetch'; |
||
2 | |||
3 | import { isFetchError } from '../checker'; |
||
4 | |||
5 | describe('isFetchError', () => { |
||
6 | it('checks isomorphic-fetch Response Error correctly', () => { |
||
7 | const e = new Response('', { status: 404 }); |
||
|
|||
8 | const result = isFetchError(e); |
||
9 | expect(result).toBe(true); |
||
10 | }); |
||
11 | |||
12 | it('checks node-fetch Response Error correctly', () => { |
||
13 | const e = new fetch.Response('', { status: 404 }); |
||
14 | const result = isFetchError(e); |
||
15 | expect(result).toBe(true); |
||
16 | }); |
||
17 | |||
18 | it('checks fetch Network Error correctly', () => { |
||
19 | const e = new fetch.FetchError('some message'); |
||
20 | const result = isFetchError(e); |
||
21 | expect(result).toBe(true); |
||
22 | }); |
||
23 | |||
24 | it('check system error correctly', () => { |
||
25 | const e = new Error('some message'); |
||
26 | const result = isFetchError(e); |
||
27 | expect(result).toBe(false); |
||
28 | }); |
||
29 | }); |
||
30 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.