| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 06c339d commit cb03e74
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,16 +4,15 @@ var assert = require('assert'); | |||
| 4 | 4 | var fs = require('fs'); | |
| 5 | 5 | ||
| 6 | 6 | function check(async, sync) { | |
| 7 | - var expected = /Path must be a string without null bytes/; | ||
| 8 | - var argsSync = Array.prototype.slice.call(arguments, 2); | ||
| 9 | - var argsAsync = argsSync.concat(function(er) { | ||
| 7 | + const expected = /Path must be a string without null bytes/; | ||
| 8 | + const argsSync = Array.prototype.slice.call(arguments, 2); | ||
| 9 | + const argsAsync = argsSync.concat((er) => { | ||
| 10 | 10 | assert(er && er.message.match(expected)); | |
| 11 | - assert.equal(er.code, 'ENOENT'); | ||
| 11 | + assert.strictEqual(er.code, 'ENOENT'); | ||
| 12 | 12 | }); | |
| 13 | 13 | ||
| 14 | 14 | if (sync) | |
| 15 | - assert.throws(function() { | ||
| 16 | - console.error(sync.name, argsSync); | ||
| 15 | + assert.throws(() => { | ||
| 17 | 16 | sync.apply(null, argsSync); | |
| 18 | 17 | }, expected); | |
| 19 | 18 | ||
@@ -51,7 +50,7 @@ check(fs.writeFile, fs.writeFileSync, 'foo\u0000bar'); | |||
| 51 | 50 | ||
| 52 | 51 | // an 'error' for exists means that it doesn't exist. | |
| 53 | 52 | // one of many reasons why this file is the absolute worst. | |
| 54 | - fs.exists('foo\u0000bar', function(exists) { | ||
| 53 | + fs.exists('foo\u0000bar', common.mustCall((exists) => { | ||
| 55 | 54 | assert(!exists); | |
| 56 | - }); | ||
| 55 | + })); | ||
| 57 | 56 | assert(!fs.existsSync('foo\u0000bar')); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments