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
3 changes: 1 addition & 2 deletions test/addons-napi/test_dataview/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ const buffer = new ArrayBuffer(128);
const template = Reflect.construct(DataView, [buffer]);

const theDataview = test_dataview.CreateDataView(template);
assert.ok(theDataview instanceof DataView,
'The new variable should be of type Dataview');
assert.ok(theDataview instanceof DataView);
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.

I think it would be best to include the actual instanceof value in the error message here instead of just removing the message.

Copy link
Copy Markdown
Member

@Trott Trott Oct 12, 2017

Choose a reason for hiding this comment

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

The value of theDataView instanceof DataView will reliably be true or false and thus false if this fails. What might be useful is displaying the value of theDataView so it can be obvious why that failed. If theDataView is undefined rather than some kind of complex object, that's useful info.

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.

Can you change the message to

`Expect ${theDataview} to be a Dataview`

like what @Trott suggested?