Skip to content

Commit 574b39e

Browse files
committed
add test
1 parent 26fb084 commit 574b39e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exports.$Enums = {};
2+
exports.AccessLevel = exports.$Enums.AccessLevel = {
3+
TEST: 'TEST',
4+
};

packages/commonjs/test/test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,16 @@ test('import CommonJS module with esm property should get default export ', asyn
289289
t.is(result2.error.message, 'libExports is not a function');
290290
});
291291

292+
test('test named exports from cjs', async (t) => {
293+
const bundle = await rollup({
294+
input: 'fixtures/samples/named-cjs-exports/main.cjs',
295+
plugins: [commonjs()]
296+
});
297+
298+
t.plan(3);
299+
await testBundle(t, bundle);
300+
});
301+
292302
test('identifies named exports from object literals', async (t) => {
293303
const bundle = await rollup({
294304
input: 'fixtures/samples/named-exports-from-object-literal/main.js',

0 commit comments

Comments
 (0)