Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
test: update inspect Promise output
Browse files Browse the repository at this point in the history
PR-URL: #474
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Reviewed-By: Jimmy Thomson <[email protected]>
Reviewed-By: Seth Brenith <[email protected]>
  • Loading branch information
kfarnung committed Mar 9, 2018
1 parent 4752fc8 commit 0ef0b17
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,11 @@ if (!common.isChakraEngine) {
obj = vm.runInNewContext('var s=new Set();s.add(1);s.add(2);s', {});
assert.strictEqual(util.inspect(obj), 'Set { 1, 2 }');
obj = vm.runInNewContext('fn=function(){};new Promise(fn,fn)', {});
assert.strictEqual(util.inspect(obj), common.engineSpecificMessage({
v8: 'Promise { <pending> }',
chakracore: 'Promise {}'
}));
assert.strictEqual(util.inspect(obj),
common.engineSpecificMessage({
v8: 'Promise { <pending> }',
chakracore: 'Promise {}'
}));
}

// test for property descriptors
Expand Down Expand Up @@ -892,6 +893,8 @@ if (typeof Symbol !== 'undefined') {
}

// test Promise
// NOTE: ChakraCore promise objects are only inspectable when created from
// native code. Promises created in script will always show as `<pending>`.
{
const resolved = Promise.resolve(3);
assert.strictEqual(util.inspect(resolved),
Expand Down

0 comments on commit 0ef0b17

Please sign in to comment.