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

@toboid toboid 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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 6, 2017
@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$/);
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@hiroppy hiroppy added the buffer Issues and PRs related to the buffer subsystem. label Feb 7, 2017
@fhalde
Copy link
Contributor

fhalde commented Feb 7, 2017

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

@toboid toboid force-pushed the improve-buffer-includes-tests branch from a694127 to 83c8f29 Compare February 7, 2017 21:13
@toboid toboid changed the title Improve buffer.includes error verification tests test,buffer: improve buffer.includes error verification tests Feb 7, 2017
@Trott
Copy link
Member

Trott 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
Copy link
Contributor Author

toboid commented Feb 7, 2017

test tag make sense to me for the reasons you outlined

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green.

@Trott
Copy link
Member

Trott commented Feb 7, 2017

@toboid
Copy link
Contributor Author

toboid 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
Copy link
Member

Trott commented Feb 8, 2017

@fhalde
Copy link
Contributor

fhalde 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
Copy link
Member

jasnell commented Feb 8, 2017

CI failures on freebsd are unrelated

@Trott
Copy link
Member

Trott commented Feb 8, 2017

jasnell pushed a commit that referenced this pull request Feb 11, 2017
* 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
Copy link
Member

jasnell commented Feb 11, 2017

Landed in 1544d8f

@italoacasas
Copy link
Contributor

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

krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
* 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 mentioned this pull request Apr 4, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@gibfahn
Copy link
Member

gibfahn 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
Copy link
Member

targos commented Jun 19, 2017

I am backporting this with #12270

gibfahn pushed a commit that referenced this pull request Jun 19, 2017
* 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 pushed a commit that referenced this pull request Jun 20, 2017
* 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 pushed a commit that referenced this pull request Jul 11, 2017
* 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 mentioned this pull request Jul 18, 2017
abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this pull request May 5, 2024
* verify error message
* use arrow funcs

PR-URL: nodejs/node#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants