| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c93df0c commit c42eb5d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,24 +60,14 @@ assert.throws(() => { | |||
| 60 | 60 | test_error.throwTypeError(); | |
| 61 | 61 | }, /^TypeError: type error$/); | |
| 62 | 62 | ||
| 63 | - function testThrowArbitrary(value) { | ||
| 64 | - assert.throws( | ||
| 63 | + [42, {}, [], Symbol('xyzzy'), true, 'ball', undefined, null, NaN] | ||
| 64 | + .forEach((value) => assert.throws( | ||
| 65 | 65 | () => test_error.throwArbitrary(value), | |
| 66 | 66 | (err) => { | |
| 67 | 67 | assert.strictEqual(err, value); | |
| 68 | 68 | return true; | |
| 69 | - }); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - testThrowArbitrary(42); | ||
| 73 | - testThrowArbitrary({}); | ||
| 74 | - testThrowArbitrary([]); | ||
| 75 | - testThrowArbitrary(Symbol('xyzzy')); | ||
| 76 | - testThrowArbitrary(true); | ||
| 77 | - testThrowArbitrary('ball'); | ||
| 78 | - testThrowArbitrary(undefined); | ||
| 79 | - testThrowArbitrary(null); | ||
| 80 | - testThrowArbitrary(NaN); | ||
| 69 | + } | ||
| 70 | + )); | ||
| 81 | 71 | ||
| 82 | 72 | common.expectsError( | |
| 83 | 73 | () => test_error.throwErrorCode(), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments