| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c094b2a commit c034c86
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + // Check the error condition testing for passing something other than a string | ||
| 4 | + // or buffer. | ||
| 5 | + | ||
| 6 | + require('../common'); | ||
| 7 | + const assert = require('assert'); | ||
| 8 | + const zlib = require('zlib'); | ||
| 9 | + | ||
| 10 | + const expected = /^TypeError: Not a string or buffer$/; | ||
| 11 | + | ||
| 12 | + assert.throws(() => { zlib.deflateSync(undefined); }, expected); | ||
| 13 | + assert.throws(() => { zlib.deflateSync(null); }, expected); | ||
| 14 | + assert.throws(() => { zlib.deflateSync(true); }, expected); | ||
| 15 | + assert.throws(() => { zlib.deflateSync(false); }, expected); | ||
| 16 | + assert.throws(() => { zlib.deflateSync(0); }, expected); | ||
| 17 | + assert.throws(() => { zlib.deflateSync(1); }, expected); | ||
| 18 | + assert.throws(() => { zlib.deflateSync([1, 2, 3]); }, expected); | ||
| 19 | + assert.throws(() => { zlib.deflateSync({foo: 'bar'}); }, expected); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments