Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change last var to const, add assert.strictEqual()
Add `assert.strictEqual(err.code, 'ENOENT')` and changed the last `var` to `const` for clarity
  • Loading branch information
Jenna Vuong authored Oct 11, 2016
commit be11d1a33b4d94b68af077136569e76a3edb5ea4
3 changes: 2 additions & 1 deletion test/parallel/test-file-read-noexist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const assert = require('assert');
const path = require('path');
const fs = require('fs');

var filename = path.join(common.fixturesDir, 'does_not_exist.txt');
const filename = path.join(common.fixturesDir, 'does_not_exist.txt');
fs.readFile(filename, 'latin1', common.mustCall(function(err, content) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we add a line after assert.ok(err) like assert.strictEqual(err.code, 'ENOENT') or whatever the right error code is? I assume it will be the same across platform, but correction welcome.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

assert.ok(err);
assert.strictEqual(err.code, 'ENOENT')
}));