diff --git a/test/unit/shared/utils/package-analysis.spec.ts b/test/unit/shared/utils/package-analysis.spec.ts index 2dc3b4de1d..f217a72637 100644 --- a/test/unit/shared/utils/package-analysis.spec.ts +++ b/test/unit/shared/utils/package-analysis.spec.ts @@ -91,6 +91,27 @@ describe('detectModuleFormat', () => { // npm treats packages without type field as CommonJS expect(detectModuleFormat({})).toBe('cjs') }) + + it('detect dual from JSON exports', () => { + expect( + detectModuleFormat({ + main: 'test.json', + exports: { + '.': './test.json', + }, + }), + ).toBe('dual') + }) + + it('detect esm from JSON exports', () => { + expect( + detectModuleFormat({ + exports: { + '.': './test.json', + }, + }), + ).toBe('esm') + }) }) describe('detectTypesStatus', () => {