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

Commit

Permalink
fixup: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesBorins committed Mar 7, 2019
1 parent 5c81e3d commit 337063e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/internal/modules/esm/translators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
3 changes: 1 addition & 2 deletions test/es-module/test-esm-json-cache.mjs
Original file line number Diff line number Diff line change
@@ -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');
3 changes: 0 additions & 3 deletions test/es-module/test-esm-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 337063e

Please sign in to comment.