Skip to content

Commit

Permalink
chore: add test verifying namespace export support (#10751)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 31, 2020
1 parent 1a06c2c commit 16c082c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Expand Up @@ -10,7 +10,7 @@ Ran all test suites matching /native-esm.tla.test.js/i.
exports[`on node ^12.16.0 || >=13.7.0 runs test with native ESM 1`] = `
Test Suites: 1 passed, 1 total
Tests: 16 passed, 16 total
Tests: 17 passed, 17 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm.test.js/i.
Expand Down
5 changes: 5 additions & 0 deletions e2e/native-esm/__tests__/native-esm.test.js
Expand Up @@ -21,6 +21,7 @@ import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2';
/* eslint-enable */
import {double} from '../index';
import defaultFromCjs, {namedFunction} from '../namedExport.cjs';
import {bag} from '../namespaceExport.js';

test('should have correct import.meta', () => {
expect(typeof require).toBe('undefined');
Expand Down Expand Up @@ -151,3 +152,7 @@ test('supports file urls as imports', async () => {

expect(dynamic.default).toBe(staticImportedStateful);
});

test('namespace export', () => {
expect(bag.double).toBe(double);
});
8 changes: 8 additions & 0 deletions e2e/native-esm/namespaceExport.js
@@ -0,0 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

export * as bag from './index.js';

0 comments on commit 16c082c

Please sign in to comment.