tangled mirror of catsky-馃惐 Soothing soft social-app fork with all the niche toggles! (Unofficial); for issues and PRs please put them on github:NekoDrone/catsky-social
1import {isNetworkError} from '../../src/lib/strings/errors'
2
3describe('isNetworkError', () => {
4 const inputs = [
5 'TypeError: Network request failed',
6 'Uncaught TypeError: Cannot read property x of undefined',
7 'Uncaught RangeError',
8 'Error: Aborted',
9 ]
10 const outputs = [true, false, false, true]
11
12 for (let i = 0; i < inputs.length; i++) {
13 const input = inputs[i]
14 const output = outputs[i]
15 it(`correctly distinguishes network errors for ${input}`, () => {
16 expect(isNetworkError(input)).toEqual(output)
17 })
18 }
19})