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

test: remove eslint comments #12669

Merged
merged 2 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 4 additions & 7 deletions test/parallel/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ assert.strictEqual(false, util.isRegExp(Object.create(RegExp.prototype)));
// isDate
assert.strictEqual(true, util.isDate(new Date()));
assert.strictEqual(true, util.isDate(new Date(0)));
// eslint-disable-next-line new-parens
assert.strictEqual(true, util.isDate(new (context('Date'))));
assert.strictEqual(true, util.isDate(new (context('Date'))()));
assert.strictEqual(false, util.isDate(Date()));
assert.strictEqual(false, util.isDate({}));
assert.strictEqual(false, util.isDate([]));
Expand All @@ -64,11 +63,9 @@ assert.strictEqual(false, util.isDate(Object.create(Date.prototype)));
assert.strictEqual(true, util.isError(new Error()));
assert.strictEqual(true, util.isError(new TypeError()));
assert.strictEqual(true, util.isError(new SyntaxError()));
/* eslint-disable new-parens */
assert.strictEqual(true, util.isError(new (context('Error'))));
assert.strictEqual(true, util.isError(new (context('TypeError'))));
assert.strictEqual(true, util.isError(new (context('SyntaxError'))));
/* eslint-enable */
assert.strictEqual(true, util.isError(new (context('Error'))()));
assert.strictEqual(true, util.isError(new (context('TypeError'))()));
assert.strictEqual(true, util.isError(new (context('SyntaxError'))()));
assert.strictEqual(false, util.isError({}));
assert.strictEqual(false, util.isError({ name: 'Error', message: '' }));
assert.strictEqual(false, util.isError([]));
Expand Down
8 changes: 3 additions & 5 deletions test/parallel/test-whatwg-url-tojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ const common = require('../common');
const URL = require('url').URL;
const { test, assert_equals } = common.WPT;

/* eslint-disable */
/* WPT Refs:
https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/
test(() => {
const a = new URL("https://example.com/")
assert_equals(JSON.stringify(a), "\"https://example.com/\"")
})
/* eslint-enable */
const a = new URL('https://example.com/');
Copy link
Member

Choose a reason for hiding this comment

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

Oops, I don't think we wanted to make this change because now we can't do straight copy/paste from https://github.com/w3c/web-platform-tests/blob/02585db/url/url-tojson.html anymore. (Or is that test unlikely to ever change so this is OK? /cc @TimothyGu @joyeecheung)

Copy link
Member

Choose a reason for hiding this comment

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

This should probably be reverted..also, the test suites are dual-licensed. I am not sure which license we are using but generally:

performance claims can only be made against unaltered tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably need to have useful comments in place for these cases then.

Copy link
Member

Choose a reason for hiding this comment

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

@cjihrig Not sure if it's a good idea to put a link to https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#imported-tests ? (the link can change though)

Revert opened in #12743

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No real opinion on whether we should link to that or not, but we should definitely say something along the lines of do not modify. Preferably right next to the eslint disable comment.

assert_equals(JSON.stringify(a), '"https://example.com/"');
});