Skip to content

Commit 16c082c

Browse files
authored
chore: add test verifying namespace export support (#10751)
1 parent 1a06c2c commit 16c082c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Ran all test suites matching /native-esm.tla.test.js/i.
1010
1111
exports[`on node ^12.16.0 || >=13.7.0 runs test with native ESM 1`] = `
1212
Test Suites: 1 passed, 1 total
13-
Tests: 16 passed, 16 total
13+
Tests: 17 passed, 17 total
1414
Snapshots: 0 total
1515
Time: <<REPLACED>>
1616
Ran all test suites matching /native-esm.test.js/i.

e2e/native-esm/__tests__/native-esm.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2';
2121
/* eslint-enable */
2222
import {double} from '../index';
2323
import defaultFromCjs, {namedFunction} from '../namedExport.cjs';
24+
import {bag} from '../namespaceExport.js';
2425

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

152153
expect(dynamic.default).toBe(staticImportedStateful);
153154
});
155+
156+
test('namespace export', () => {
157+
expect(bag.double).toBe(double);
158+
});

e2e/native-esm/namespaceExport.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
export * as bag from './index.js';

0 commit comments

Comments
 (0)