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
squash: make test.js follow test style guidelines
  • Loading branch information
danbev committed Aug 13, 2017
commit 32a3027a9f8cb55ebce893755c7251d5a5a7f20e
6 changes: 6 additions & 0 deletions test/addons/errno-exception/test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

const common = require('../../common');

// Verify that the path argument to node::ErrnoException() can contain UTF-8
// characters.

const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
const err = binding.errno();

assert.strictEqual(err.syscall, 'syscall');
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 time (from the guide)...

'use strict';

const common = require('../../common');

// Verify that the path argument to node::ErrnoException() can contain UTF-8
// characters.

const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
const err = binding.errno();

assert.strictEqual(err.syscall, 'syscall');
assert.strictEqual(err.errno, 10);
assert.strictEqual(err.path, 'päth');

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.

Thanks, I'll update this.

assert.strictEqual(err.errno, 10);
assert.strictEqual(err.path, 'päth');
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.

As a tiny suggestion, maybe check err.message as well :)

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.

Oh, yes :) Thanks

Expand Down