From 337063e373fe7f19a3d2a83e9c6f8901f3fb219f Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Thu, 7 Mar 2019 00:58:54 -0500 Subject: [PATCH] fixup: tests --- lib/internal/modules/esm/translators.js | 3 +-- test/es-module/test-esm-json-cache.mjs | 3 +-- test/es-module/test-esm-json.mjs | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 52eaa95aaa..243d33e7e8 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -125,7 +125,6 @@ translators.set('json', async (url) => { CJSModule._cache[modulePath] = module; return createDynamicModule(['default'], url, (reflect) => { debug(`Parsing JSONModule ${url}`); - reflect.exports.default.set(module.exports); - + reflect.exports.default.set(module.exports); }); }); diff --git a/test/es-module/test-esm-json-cache.mjs b/test/es-module/test-esm-json-cache.mjs index 53a5123f09..3a4ee6da5f 100644 --- a/test/es-module/test-esm-json-cache.mjs +++ b/test/es-module/test-esm-json-cache.mjs @@ -1,13 +1,12 @@ // Flags: --experimental-modules --experimental-json-modules /* eslint-disable node-core/required-modules */ import '../common/index.mjs'; -import {strictEqual} from 'assert'; +import { strictEqual } from 'assert'; import mod from '../fixtures/es-modules/json-cache/mod.cjs'; import another from '../fixtures/es-modules/json-cache/another.cjs'; import test from '../fixtures/es-modules/json-cache/test.json'; - strictEqual(mod.one, 1); strictEqual(another.one, 'zalgo'); strictEqual(test.one, 'it comes'); diff --git a/test/es-module/test-esm-json.mjs b/test/es-module/test-esm-json.mjs index 9c23b44b0b..b140d031ca 100644 --- a/test/es-module/test-esm-json.mjs +++ b/test/es-module/test-esm-json.mjs @@ -5,8 +5,5 @@ import '../common/index.mjs'; import { strictEqual } from 'assert'; import secret from '../fixtures/experimental.json'; -import * as namespace from '../fixtures/experimental.json'; strictEqual(secret.ofLife, 42); -strictEqual(namespace.ofLife, undefined); -strictEqual(namespace.default.ofLife, 42);