| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9840f50 commit 4bbd50e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,8 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - var common = require('../common'); | ||
| 3 | - var assert = require('assert'); | ||
| 4 | - var exec = require('child_process').exec; | ||
| 5 | - var path = require('path'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const exec = require('child_process').exec; | ||
| 5 | + const path = require('path'); | ||
| 6 | 6 | ||
| 7 | 7 | // `fs.readFile('/')` does not fail on FreeBSD, because you can open and read | |
| 8 | 8 | // the directory there. | |
@@ -14,28 +14,28 @@ if (process.platform === 'freebsd') { | |||
| 14 | 14 | var callbacks = 0; | |
| 15 | 15 | ||
| 16 | 16 | function test(env, cb) { | |
| 17 | - var filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js'); | ||
| 18 | - var execPath = '"' + process.execPath + '" "' + filename + '"'; | ||
| 19 | - var options = { env: Object.assign(process.env, env) }; | ||
| 20 | - exec(execPath, options, function(err, stdout, stderr) { | ||
| 17 | + const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js'); | ||
| 18 | + const execPath = '"' + process.execPath + '" "' + filename + '"'; | ||
| 19 | + const options = { env: Object.assign(process.env, env) }; | ||
| 20 | + exec(execPath, options, common.mustCall((err, stdout, stderr) => { | ||
| 21 | 21 | assert(err); | |
| 22 | - assert.equal(stdout, ''); | ||
| 23 | - assert.notEqual(stderr, ''); | ||
| 22 | + assert.strictEqual(stdout, ''); | ||
| 23 | + assert.notStrictEqual(stderr, ''); | ||
| 24 | 24 | cb('' + stderr); | |
| 25 | - }); | ||
| 25 | + })); | ||
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | - test({ NODE_DEBUG: '' }, function(data) { | ||
| 28 | + test({ NODE_DEBUG: '' }, common.mustCall((data) => { | ||
| 29 | 29 | assert(/EISDIR/.test(data)); | |
| 30 | 30 | assert(!/test-fs-readfile-error/.test(data)); | |
| 31 | 31 | callbacks++; | |
| 32 | - }); | ||
| 32 | + })); | ||
| 33 | 33 | ||
| 34 | - test({ NODE_DEBUG: 'fs' }, function(data) { | ||
| 34 | + test({ NODE_DEBUG: 'fs' }, common.mustCall((data) => { | ||
| 35 | 35 | assert(/EISDIR/.test(data)); | |
| 36 | 36 | assert(/test-fs-readfile-error/.test(data)); | |
| 37 | 37 | callbacks++; | |
| 38 | - }); | ||
| 38 | + })); | ||
| 39 | 39 | ||
| 40 | 40 | process.on('exit', function() { | |
| 41 | 41 | assert.equal(callbacks, 2); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments