Skip to content

test: remove messages for assert - #16814

Closed
ka3e wants to merge 2 commits into
nodejs:masterfrom
ka3e:contribution
Closed

test: remove messages for assert#16814
ka3e wants to merge 2 commits into
nodejs:masterfrom
ka3e:contribution

Conversation

@ka3e

@ka3eka3e commented Nov 6, 2017

Copy link
Copy Markdown
Contributor

Removes message from assert
Add global comment

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

test

@nodejs-github-botnodejs-github-bot added dont-land-on-v4.x node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels Nov 6, 2017
@gireeshpunathilgireeshpunathil added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
@Trott

Trott commented Nov 7, 2017

Copy link
Copy Markdown
Member

@Trott

Trott commented Nov 7, 2017

Copy link
Copy Markdown
Member

Looks like CI may have been having issues. Let's try agian.

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

const test_promise = require(`./build/${common.buildType}/test_promise`);
const assert = require('assert');

// Testing api calls for promises

@joyeecheungjoyeecheungNov 7, 2017

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.

Can you format the comment as what testing guide suggests?

'use strict';constcommon=require('../../common');// This tests the promise-related n-api callsconstassert=require('assert');consttest_promise=require(`./build/${common.buildType}/test_promise`);

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done!

common.mustNotCall());
test_promise.concludeCurrentPromise(Promise.resolve('chained answer'), true);

assert.strictEqual(test_promise.isPromise(promise), true);

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 one does not seem to belong here, can you move it back?

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.

@joyeecheung I suggested putting it in there because it uses promise because it was declared in that block. But looking more closely, perhaps we should create a separate promise object for this.

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.

Hmm yes, actually it should be assert.strictEqual(test_promise.isPromise(test_promise.createPromise()), true); then it can be safely moved down.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I moved it out from the block, created new promise as @joyeecheung suggested

}

assert.strictEqual(test_promise.isPromise(promise), true);
assert.strictEqual(test_promise.isPromise(test_promise.createPromise()), true);

@TrottTrottNov 8, 2017

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.

@kkwoker@gabrielschulhof Any idea if this changes the test in a significant/important way? Specifically, I'm not sure if promise having a .then() already attached is significant to this assertion or not.

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.

@Trott I don't think it's significant.

@gireeshpunathil

Copy link
Copy Markdown
Member

ping @ka3e

@Trott

Copy link
Copy Markdown
Member

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 13, 2017
* remove custom messages for assert that conceal values
* add comment explaining test
* add block scoping
PR-URL: nodejs#16814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott

Copy link
Copy Markdown
Member

Landed in 51f92b6.

Thanks for the contribution! 🎉

@TrottTrott closed this Nov 13, 2017
@ka3e
ka3e deleted the contribution branch November 13, 2017 23:02
evanlucas pushed a commit that referenced this pull request Nov 14, 2017
* remove custom messages for assert that conceal values
* add comment explaining test
* add block scoping
PR-URL: #16814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit that referenced this pull request Dec 13, 2017
* remove custom messages for assert that conceal values
* add comment explaining test
* add block scoping
PR-URL: #16814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Dec 20, 2017
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 16, 2018
* remove custom messages for assert that conceal values
* add comment explaining test
* add block scoping
PR-URL: nodejs#16814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
* remove custom messages for assert that conceal values
* add comment explaining test
* add block scoping
Backport-PR-URL: #19447
PR-URL: #16814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Apr 16, 2018
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.node-apiIssues and PRs related to the Node-API.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@ka3e@Trott@gireeshpunathil@jasnell@gabrielschulhof@joyeecheung@gibfahn@nodejs-github-bot