| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 26d8e96 commit 94fd8f3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,22 +1,24 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common'); | |
| 3 | - var assert = require('assert'); | ||
| 4 | - var exec = require('child_process').exec; | ||
| 5 | - var os = require('os'); | ||
| 6 | - var str = 'hello'; | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const exec = require('child_process').exec; | ||
| 5 | + const os = require('os'); | ||
| 6 | + const str = 'hello'; | ||
| 7 | 7 | ||
| 8 | 8 | // default encoding | |
| 9 | 9 | exec('echo ' + str, common.mustCall(function(err, stdout, stderr) { | |
| 10 | - assert.ok('string', typeof stdout, 'Expected stdout to be a string'); | ||
| 11 | - assert.ok('string', typeof stderr, 'Expected stderr to be a string'); | ||
| 12 | - assert.equal(str + os.EOL, stdout); | ||
| 10 | + assert.strictEqual(typeof stdout, 'string', 'Expected stdout to be a string'); | ||
| 11 | + assert.strictEqual(typeof stderr, 'string', 'Expected stderr to be a string'); | ||
| 12 | + assert.strictEqual(str + os.EOL, stdout); | ||
| 13 | 13 | })); | |
| 14 | 14 | ||
| 15 | 15 | // no encoding (Buffers expected) | |
| 16 | 16 | exec('echo ' + str, { | |
| 17 | 17 | encoding: null | |
| 18 | 18 | }, common.mustCall(function(err, stdout, stderr) { | |
| 19 | - assert.ok(stdout instanceof Buffer, 'Expected stdout to be a Buffer'); | ||
| 20 | - assert.ok(stderr instanceof Buffer, 'Expected stderr to be a Buffer'); | ||
| 21 | - assert.equal(str + os.EOL, stdout.toString()); | ||
| 19 | + assert.strictEqual(stdout instanceof Buffer, true, | ||
| 20 | + 'Expected stdout to be a Buffer'); | ||
| 21 | + assert.strictEqual(stderr instanceof Buffer, true, | ||
| 22 | + 'Expected stderr to be a Buffer'); | ||
| 23 | + assert.strictEqual(str + os.EOL, stdout.toString()); | ||
| 22 | 24 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments