Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test match others in repository #15935

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
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
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?