MCPcopy Index your code
hub / github.com/nodejs/node / expectOkNamespace

Function expectOkNamespace

test/es-module/test-esm-dynamic-import.js:17–27  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

15}
16
17function expectOkNamespace(result) {
18 Promise.resolve(result)
19 .then(common.mustCall((ns) => {
20 const expected = { default: true };
21 Object.defineProperty(expected, Symbol.toStringTag, {
22 value: 'Module',
23 });
24 Object.setPrototypeOf(expected, Object.getPrototypeOf(ns));
25 assert.deepStrictEqual(ns, expected);
26 }));
27}
28
29function expectFsNamespace(result) {
30 Promise.resolve(result)

Callers 1

Calls 3

thenMethod · 0.45
resolveMethod · 0.45
definePropertyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…