@@ -15,7 +15,7 @@ assert.ok(new zlib.DeflateRaw() instanceof zlib.DeflateRaw); |
15 | 15 | // Throws if `opts.chunkSize` is invalid |
16 | 16 | assert.throws( |
17 | 17 | () => { new zlib.Deflate({chunkSize: -Infinity}); }, |
18 | | - /^Error: Invalid chunk size: -Infinity$/ |
| 18 | + /^RangeError: Invalid chunk size: -Infinity$/ |
19 | 19 | ); |
20 | 20 |
|
21 | 21 | // Confirm that maximum chunk size cannot be exceeded because it is `Infinity`. |
@@ -24,23 +24,23 @@ assert.strictEqual(zlib.constants.Z_MAX_CHUNK, Infinity); |
24 | 24 | // Throws if `opts.windowBits` is invalid |
25 | 25 | assert.throws( |
26 | 26 | () => { new zlib.Deflate({windowBits: -Infinity}); }, |
27 | | - /^Error: Invalid windowBits: -Infinity$/ |
| 27 | + /^RangeError: Invalid windowBits: -Infinity$/ |
28 | 28 | ); |
29 | 29 |
|
30 | 30 | assert.throws( |
31 | 31 | () => { new zlib.Deflate({windowBits: Infinity}); }, |
32 | | - /^Error: Invalid windowBits: Infinity$/ |
| 32 | + /^RangeError: Invalid windowBits: Infinity$/ |
33 | 33 | ); |
34 | 34 |
|
35 | 35 | // Throws if `opts.level` is invalid |
36 | 36 | assert.throws( |
37 | 37 | () => { new zlib.Deflate({level: -Infinity}); }, |
38 | | - /^Error: Invalid compression level: -Infinity$/ |
| 38 | + /^RangeError: Invalid compression level: -Infinity$/ |
39 | 39 | ); |
40 | 40 |
|
41 | 41 | assert.throws( |
42 | 42 | () => { new zlib.Deflate({level: Infinity}); }, |
43 | | - /^Error: Invalid compression level: Infinity$/ |
| 43 | + /^RangeError: Invalid compression level: Infinity$/ |
44 | 44 | ); |
45 | 45 |
|
46 | 46 | // Throws a RangeError if `level` invalid in `Deflate.prototype.params()` |
@@ -57,12 +57,12 @@ assert.throws( |
57 | 57 | // Throws if `opts.memLevel` is invalid |
58 | 58 | assert.throws( |
59 | 59 | () => { new zlib.Deflate({memLevel: -Infinity}); }, |
60 | | - /^Error: Invalid memLevel: -Infinity$/ |
| 60 | + /^RangeError: Invalid memLevel: -Infinity$/ |
61 | 61 | ); |
62 | 62 |
|
63 | 63 | assert.throws( |
64 | 64 | () => { new zlib.Deflate({memLevel: Infinity}); }, |
65 | | - /^Error: Invalid memLevel: Infinity$/ |
| 65 | + /^RangeError: Invalid memLevel: Infinity$/ |
66 | 66 | ); |
67 | 67 |
|
68 | 68 | // Does not throw if opts.strategy is valid |
@@ -89,13 +89,13 @@ assert.doesNotThrow( |
89 | 89 | // Throws if opt.strategy is the wrong type. |
90 | 90 | assert.throws( |
91 | 91 | () => { new zlib.Deflate({strategy: '' + zlib.constants.Z_RLE }); }, |
92 | | - /^Error: Invalid strategy: 3$/ |
| 92 | + /^TypeError: Invalid strategy: 3$/ |
93 | 93 | ); |
94 | 94 |
|
95 | 95 | // Throws if opts.strategy is invalid |
96 | 96 | assert.throws( |
97 | 97 | () => { new zlib.Deflate({strategy: 'this is a bogus strategy'}); }, |
98 | | - /^Error: Invalid strategy: this is a bogus strategy$/ |
| 98 | + /^TypeError: Invalid strategy: this is a bogus strategy$/ |
99 | 99 | ); |
100 | 100 |
|
101 | 101 | // Throws TypeError if `strategy` is invalid in `Deflate.prototype.params()` |
@@ -107,5 +107,5 @@ assert.throws( |
107 | 107 | // Throws if opts.dictionary is not a Buffer |
108 | 108 | assert.throws( |
109 | 109 | () => { new zlib.Deflate({dictionary: 'not a buffer'}); }, |
110 | | - /^Error: Invalid dictionary: it should be a Buffer instance$/ |
| 110 | + /^TypeError: Invalid dictionary: it should be a Buffer instance$/ |
111 | 111 | ); |