Skip to content

test: add Symbol test for assert.deepEqual() - #3327

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:add-symbol-test
Closed

test: add Symbol test for assert.deepEqual()#3327
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:add-symbol-test

Conversation

@Trott

Copy link
Copy Markdown
Member

The existing test never ran because typeof Symbol === 'function' and not
'symbol'. Update to Symbol() which will be a symbol and not a function.

The existing test never ran because typeof Symbol === 'function' and not
'symbol'. Update to Symbol() which will be a symbol and not a function.
@TrottTrott added the test Issues and PRs related to the tests. label Oct 12, 2015
@Trott

Copy link
Copy Markdown
MemberAuthor

@evanlucas

Copy link
Copy Markdown
Contributor

I would think we should maybe even go as far as adding tests for things like:

assert.throws(function() {
assert.deepEqual(Symbol('a'), Symbol('a'));
});
assert.deepEqual(Symbol.for('a'), Symbol.for('a'));

What are your thoughts on that?

@mscdexmscdex added the assert Issues and PRs related to the assert subsystem. label Oct 12, 2015
@Trott

Copy link
Copy Markdown
MemberAuthor

@evanlucas I think your first example is handled in this test addition over at #3124. However, that PR very possibly may never land, so let's put a pin in that for sure....

The second example you give, oh yes!

@vkurchatkin

Copy link
Copy Markdown
Contributor

It would be nice to have code coverage to catch such things

@jasnell

Copy link
Copy Markdown
Member

LGTM

@Trott

Copy link
Copy Markdown
MemberAuthor

@evanlucas On the one hand, #3124 got closed, so that suggests adding the tests you proposed separately. On the other hand, TSC agreed this week to lock Assert so any tests added would presumably only document existing behavior. So... ¯\_(ツ)_/¯

Trott added a commit that referenced this pull request Oct 16, 2015
The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.
PR-URL: #3327
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott

Copy link
Copy Markdown
MemberAuthor

Landed in 0f99320

@TrottTrott closed this Oct 16, 2015
@MylesBorins

Copy link
Copy Markdown
Contributor

If we are going to be backporting tests for LTS this should probably be tagged

@Trott

Copy link
Copy Markdown
MemberAuthor

Would the right tag be land-on-v4.x?

@MylesBorins

Copy link
Copy Markdown
Contributor

I believe so /cc @jasnell

@MylesBorins

Copy link
Copy Markdown
Contributor

Got an update.

lts-watch-v4x if the decision hasn't been made yet

@Trott

Copy link
Copy Markdown
MemberAuthor

OK, tagged. Leave it closed, reopen it, or doesn't matter either way?

@jasnell

Copy link
Copy Markdown
Member

Doesn't matter either way (open or closed)

On Fri, Oct 16, 2015 at 2:45 PM, Rich Trott notifications@github.com
wrote:

OK, tagged. Leave it closed, reopen it, or doesn't matter either way?


Reply to this email directly or view it on GitHub
#3327 (comment).

Trott added a commit that referenced this pull request Oct 19, 2015
The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.
PR-URL: #3327
Reviewed-By: James M Snell <jasnell@gmail.com>
@rvaggrvagg mentioned this pull request Oct 21, 2015
Trott added a commit that referenced this pull request Oct 26, 2015
The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.
PR-URL: #3327
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in v4.x-staging in 6305d26

Trott added a commit that referenced this pull request Oct 29, 2015
The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.
PR-URL: #3327
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Trott deleted the add-symbol-test branch January 13, 2022 22:29
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assertIssues and PRs related to the assert subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Trott@evanlucas@vkurchatkin@jasnell@MylesBorins@mscdex