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: added test for lib/internal/util/inspector.js #24997

Closed
wants to merge 2 commits into from
Closed

test: added test for lib/internal/util/inspector.js #24997

wants to merge 2 commits into from

Conversation

IlarionHalushka
Copy link
Contributor

@IlarionHalushka IlarionHalushka commented Dec 12, 2018

Test for lib/internal/util/inspector.js to make 100% test coverage.
Test checks that onError on line 19 is executed when exception is thrown

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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 12, 2018
@Trott
Copy link
Member

Trott commented Dec 12, 2018

Looks like you forgot the util part of the path in the commit message/PR description?

root is an artifact of the coverage reporting and does not exist. It's lib. There is no lib/internal/inspector.js. Looks like you mean lib/internal/util/inspector.js.

(This all can be fixed by whoever lands the PR, but if you can fix it in the commit and force push it, all the better to save someone else a bit of editing.)

Trott
Trott previously requested changes Dec 12, 2018
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.

common.mustCall() does not take a string argument. If you're intention here is to throw an error, use () => { throw new Error('foo'); } or something like that instead.

@Trott
Copy link
Member

Trott commented Dec 12, 2018

I'd prefer something that used the public APIs to trigger the error, but this will do in its absence!

@Trott
Copy link
Member

Trott commented Dec 12, 2018

And thanks for the pull request!

@IlarionHalushka IlarionHalushka changed the title test: added test for root/internal/inspector.js test: added test for lib/internal/util/inspector.js Dec 13, 2018
Test for root/internal/inspector.js to make 100% test coverage.
Test checks that onError on line 19 is executed when exception is thrown
Pass function that will throw an exception when called.
Remove 1 from common.mustCall() because 1 is a default.
@IlarionHalushka
Copy link
Contributor Author

@Trott Thanks for the review. I made the changes that you requested.

@Trott Trott dismissed their stale review December 13, 2018 20:11

review comments addressed

@lpinca
Copy link
Member

lpinca commented Mar 11, 2019

@targos targos added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 31, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

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.

There are some relevant failures in CI. It's because the inspector tests all need to be skipped if node is compiled without certain things. Can you add a line that calls common.skipIfInspectorDisabled(); like you'll see in the other test-inspector-* files?

@Trott Trott removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 29, 2019
@gireeshpunathil
Copy link
Member

@IlarionHalushka - can you pls address the review comments?

@IlarionHalushka
Copy link
Contributor Author

There is no catch in sendInspectorCommand anymore. Closing PR.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants