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: improve buffer.includes error verification tests #11203

Closed
wants to merge 2 commits into from

Conversation

@toboid
Copy link
Contributor

commented Feb 6, 2017

Verify specific errors thrown by buffer.includes and change tests to use arrow functions as per latest testing guide.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

tests, buffer

@toboid toboid changed the title Improve buffer.includes tests Improve buffer.includes error verification tests Feb 6, 2017

assert.throws(function() {
assert.throws(() => {
b.includes(() => {});
}, /^TypeError: "val" argument must be string, number, Buffer or Uint8Array$/);

This comment has been minimized.

Copy link
@cjihrig

cjihrig Feb 6, 2017

Contributor

Can you put this regular expression in a variable so that it can be reused.

@hiroppy hiroppy added the buffer label Feb 7, 2017

@hiroppy
hiroppy approved these changes Feb 7, 2017
@fhalde

This comment has been minimized.

Copy link
Contributor

commented Feb 7, 2017

Please prefix the PR with test,buffer tag. Commit message guidelines

@toboid toboid force-pushed the toboid:improve-buffer-includes-tests branch from a694127 to 83c8f29 Feb 7, 2017

@toboid toboid changed the title Improve buffer.includes error verification tests test,buffer: improve buffer.includes error verification tests Feb 7, 2017

@Trott

This comment has been minimized.

Copy link
Member

commented Feb 7, 2017

Please prefix the PR with test,buffer tag. Commit message guidelines

Gotta mildly disagree with that. Just test: is fine. This is a change to the way a test works, not anything specific to buffer. The fact that it's a buffer test is incidental. No one looking for buffer changes is going to want to see this. And adding buffer just makes it harder to keep the first line to 50 chars.

(EDIT: But if someone did put test,buffer: I wouldn't complain either. I just wouldn't insist that someone do that. And I would be especially careful with nits like that on first time contributors because they tend to internalize them as hard-and-fast rules.)

@toboid toboid changed the title test,buffer: improve buffer.includes error verification tests test: improve buffer.includes error verification tests Feb 7, 2017

@toboid

This comment has been minimized.

Copy link
Contributor Author

commented Feb 7, 2017

test tag make sense to me for the reasons you outlined

@Trott
Trott approved these changes Feb 7, 2017
Copy link
Member

left a comment

LGTM if CI is green.

@Trott

This comment has been minimized.

Copy link
Member

commented Feb 7, 2017

@jasnell
jasnell approved these changes Feb 7, 2017
@cjihrig
cjihrig approved these changes Feb 7, 2017
@toboid

This comment has been minimized.

Copy link
Contributor Author

commented Feb 7, 2017

Looks like there was an issue with the build server, it started returning http 502, now that its back the above build has disappeared, it's returning http 404. Does CI need to be kicked-off again?

@Trott

This comment has been minimized.

Copy link
Member

commented Feb 8, 2017

@fhalde

This comment has been minimized.

Copy link
Contributor

commented Feb 8, 2017

@Trott haha. It was supposed to be test or buffer. I wasn't sure what was appropriate for this case. Anyway test it is 😄

@jasnell

This comment has been minimized.

Copy link
Member

commented Feb 8, 2017

CI failures on freebsd are unrelated

@Trott

This comment has been minimized.

Copy link
Member

commented Feb 8, 2017

jasnell added a commit that referenced this pull request Feb 11, 2017
test: improve test-buffer-includes.js
* verify error message
* use arrow funcs

PR-URL: #11203
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

This comment has been minimized.

Copy link
Member

commented Feb 11, 2017

Landed in 1544d8f

@italoacasas

This comment has been minimized.

Copy link
Member

commented Feb 14, 2017

This commit is breaking tests in v7.x, maybe because of some semver-major... any plan to backport this?

KryDos added a commit to KryDos/node that referenced this pull request Feb 25, 2017
test: improve test-buffer-includes.js
* verify error message
* use arrow funcs

PR-URL: nodejs#11203
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell jasnell referenced this pull request Apr 4, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
@gibfahn

This comment has been minimized.

Copy link
Member

commented Jun 17, 2017

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

@targos

This comment has been minimized.

Copy link
Member

commented Jun 19, 2017

I am backporting this with #12270

gibfahn added a commit that referenced this pull request Jun 19, 2017
test: improve test-buffer-includes.js
* verify error message
* use arrow funcs

PR-URL: #11203
Backport-PR-URL: #13785
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn added a commit that referenced this pull request Jun 20, 2017
test: improve test-buffer-includes.js
* verify error message
* use arrow funcs

PR-URL: #11203
Backport-PR-URL: #13785
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins added a commit that referenced this pull request Jul 11, 2017
test: improve test-buffer-includes.js
* verify error message
* use arrow funcs

PR-URL: #11203
Backport-PR-URL: #13785
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.