-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: remove messages for assert #16814
Conversation
Looks like CI may have been having issues. Let's try agian. |
const assert = require('assert'); | ||
|
||
// Testing api calls for promises |
There was a problem hiding this comment.
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';
const common = require('../../common');
// This tests the promise-related n-api calls
const assert = require('assert');
const test_promise = require(`./build/${common.buildType}/test_promise`);
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ping @ka3e |
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping PR-URL: nodejs#16814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 51f92b6. Thanks for the contribution! 🎉 |
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping PR-URL: #16814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping PR-URL: #16814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping PR-URL: nodejs#16814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
* 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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
Removes message from assert
Add global comment
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test