Conversation
|
Looks like CI may have been having issues. Let's try agian. |
| const test_promise = require(`./build/${common.buildType}/test_promise`); | ||
| const assert = require('assert'); | ||
|
|
||
| // Testing api calls for promises |
There was a problem hiding this comment.
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`);| common.mustNotCall()); | ||
| test_promise.concludeCurrentPromise(Promise.resolve('chained answer'), true); | ||
|
|
||
| assert.strictEqual(test_promise.isPromise(promise), true); |
There was a problem hiding this comment.
This one does not seem to belong here, can you move it back?
There was a problem hiding this comment.
@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.
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.
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.
@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.
|
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 <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
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 <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* 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>
* 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>
Removes message from assert
Add global comment
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test