Skip to content

test: check for error on invalid signal - #10026

Closed
mattcphillips wants to merge 1 commit into
nodejs:masterfrom
mattcphillips:test/process.kill_signal_error
Closed

test: check for error on invalid signal#10026
mattcphillips wants to merge 1 commit into
nodejs:masterfrom
mattcphillips:test/process.kill_signal_error

Conversation

@mattcphillips

Copy link
Copy Markdown
Contributor
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Asserts that an error should be thrown when an invalid signal is passed to process.kill

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Dec 1, 2016
@imyllerimyller added code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. process Issues and PRs related to the process subsystem. labels Dec 1, 2016

@bnoordhuisbnoordhuis left a comment

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you put a space before this comment, e.g. // Test...? :D

Asserts that an error should be thrown when
an invalid signal is passed to process.kill
@mattcphillips
mattcphillipsforce-pushed the test/process.kill_signal_error branch from a82c7e2 to 5fdea9dCompareDecember 4, 2016 07:41

// Test that kill throws an error for invalid signal

assert.throws(function() { process.kill(1, 'test'); }, Error);

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.

This is ok but passing a regexp as the second argument would be better.

assert.throws(()=>{process.kill(1,'test');},/^Error:Unknownsignal:test$/);

@Fishrock123Fishrock123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with @jasnell's suggestion.

@Trott

Trott commented Dec 8, 2016

Copy link
Copy Markdown
Member

Trott pushed a commit to Trott/io.js that referenced this pull request Dec 9, 2016
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: nodejs#10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott

Trott commented Dec 9, 2016

Copy link
Copy Markdown
Member

Landed in 6aacef7.
Thanks for the contribution! 🎉

I agree with the nit about using a RegExp rather than a constructor for assert.throws() but there are already a half dozen other instances of assert.throws() in the file that use a constructor rather than a RegExp. So that change could (should?) be a separate PR.

@TrottTrott closed this Dec 9, 2016
Fishrock123 pushed a commit that referenced this pull request Dec 13, 2016
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@italoacasasitaloacasas mentioned this pull request Dec 15, 2016
MylesBorins pushed a commit that referenced this pull request Jan 16, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This was referenced Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Asserts that an error should be thrown when
an invalid signal is passed to process.kill().
PR-URL: #10026
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.processIssues and PRs related to the process subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@mattcphillips@Trott@bnoordhuis@jasnell@Fishrock123@cjihrig@MylesBorins@imyller@nodejs-github-bot