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: fix intrinsics test #26660

Closed
wants to merge 1 commit into from
Closed

Conversation

BridgeAR
Copy link
Member

So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.

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

So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Mar 14, 2019
@lundibundi
Copy link
Member

@lundibundi lundibundi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 14, 2019
} catch {
}
assert.throws(
() => Object.defineProperty = 'asdf',
Copy link
Member

Choose a reason for hiding this comment

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

Ignorable style micro-nit that others might not agree with anyway: I prefer braces ({ and }) in situations like this because without braces, the arrow function returns a value, and IMO we shouldn't return a value unless we are intending to return a value. Here, we are returning a value as a style side effect. Someone reading this might not know if the return value is significant. By adding braces, we make it clear it's not.

There are, of course arguments the other way. (Someone who knows how assert.throws() works will know the return value is irrelevant. Return a value or not, who cares really?) Just my opinion. I think...uh...@sam-github maybe? Someone else thinks the same way. But it's hardly universal on the project....

Anyway, code change looks good with or without this suggestion. But if I've managed to convince you, cool. 😆

Copy link
Member

Choose a reason for hiding this comment

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

I agree with you, but since the assignment throws an error, there is in fact no return value 😁

BridgeAR added a commit to BridgeAR/node that referenced this pull request Mar 18, 2019
So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.

PR-URL: nodejs#26660
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BridgeAR
Copy link
Member Author

Landed in 6d09012

@BridgeAR BridgeAR closed this Mar 18, 2019
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.

PR-URL: nodejs#26660
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2019
So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.

PR-URL: #26660
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BridgeAR BridgeAR deleted the fix-intrinsics-test branch January 20, 2020 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants