Skip to content

Conversation

@BridgeAR
Copy link
Member

Using assert.fail() with more than one argument is not intuitive
to use and has no benefit over using a message on its own.

Therefore this introduces a runtime deprecation in case it is used
in that way.

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
Affected core subsystem(s)

assert

@nodejs-github-bot nodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label Jan 28, 2018
@BridgeAR BridgeAR force-pushed the deprecate-assert-fail branch from b990b8a to 33671e2 Compare January 28, 2018 12:05
@ChALkeR ChALkeR added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 28, 2018
Copy link
Member

Choose a reason for hiding this comment

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

Nit: space after first _.

lib/assert.js Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Nit: assert.strictEqual() for consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: a individual -> an individual.

@BridgeAR
Copy link
Member Author

Comments addressed.

CI https://ci.nodejs.org/job/node-test-pull-request/12786/

Copy link
Member

Choose a reason for hiding this comment

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

The signature here looks rather confusing, since actual and expected looks required here...maybe create another section with assert.fail(message), and deprecate this signature while referencing the new one?

Copy link
Member

@joyeecheung joyeecheung Jan 29, 2018

Choose a reason for hiding this comment

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

Also, that way we can put a deprecated entry in the YAML so the whole signature would be labeled with deprecated in the TOC.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that it looks confusing. We just never had such a case before but I agree that this is probably the best way to solve this. I will change it shortly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@BridgeAR
Copy link
Member Author

Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary underscore?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps drop the *:Note*: part of this now? It's not super necessary.

Copy link
Member

Choose a reason for hiding this comment

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

s/DEP0XXX/DEP00XX

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

LGTM with one suggestion

Copy link
Member

Choose a reason for hiding this comment

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

Can you put the tests with the valid signatures to another file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@BridgeAR BridgeAR force-pushed the deprecate-assert-fail branch from 0c6d14a to 34143dd Compare February 2, 2018 15:19
@BridgeAR
Copy link
Member Author

BridgeAR commented Feb 2, 2018

Rebased due to conflicts and while doing so I also rewrote common.expectsError to assert.throws and found a mistake in one of the old tests because of that and fixed it. I also addressed @joyeecheung comment to split the tests into two files.

@BridgeAR
Copy link
Member Author

BridgeAR commented Feb 2, 2018

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM but needs a rebase

@BridgeAR BridgeAR force-pushed the deprecate-assert-fail branch from 34143dd to adc742e Compare February 2, 2018 17:36
Using `assert.fail()` with more than one argument is not intuitive
to use and has no benefit over using a message on its own.

Therefore this introduces a runtime deprecation in case it is used
in that way.
@BridgeAR BridgeAR force-pushed the deprecate-assert-fail branch from adc742e to bf4ac0c Compare February 2, 2018 17:41
@BridgeAR
Copy link
Member Author

BridgeAR commented Feb 2, 2018

Landed in 70dcacd

@BridgeAR BridgeAR closed this Feb 2, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request Feb 2, 2018
Using `assert.fail()` with more than one argument is not intuitive
to use and has no benefit over using a message on its own.

Therefore this introduces a runtime deprecation in case it is used
in that way.

PR-URL: nodejs#18418
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Using `assert.fail()` with more than one argument is not intuitive
to use and has no benefit over using a message on its own.

Therefore this introduces a runtime deprecation in case it is used
in that way.

PR-URL: nodejs#18418
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@tniessen tniessen added the deprecations Issues and PRs related to deprecations. label Sep 7, 2018
@BridgeAR BridgeAR deleted the deprecate-assert-fail branch April 1, 2019 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assert Issues and PRs related to the assert subsystem. deprecations Issues and PRs related to deprecations. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants