diff --git a/tests/exports.test.ts b/tests/exports.test.ts index 7187af52d..192efebce 100644 --- a/tests/exports.test.ts +++ b/tests/exports.test.ts @@ -5,7 +5,7 @@ import { readdirSync, readFileSync } from 'fs'; import packageJson from '../package.json'; const NOT_EXPORTED_PACKAGES = ['assets', 'demo', 'locales', 'scss', 'stories']; -const ADDITIONAL_EXPORTS = ['.', './assets/*', './plotly/full', './scss/*', './dist/scss/*', './phovea_registry', './package.json']; +const ADDITIONAL_EXPORTS = ['.', './assets/*', './plotly/full', './scss/*', './phovea_registry', './package.json']; describe('package.json exports', () => { expect(packageJson.exports).toBeDefined(); @@ -31,17 +31,15 @@ describe('package.json exports', () => { test.each(allPackages)('checks if package %s is exported', (p) => { const exported = packageJson.exports[`./${p}`]; expect(exported).toBeDefined(); - expect(Object.keys(exported)).toStrictEqual(['types', 'import', 'default']); // Some packages are exported as .tsx - const extension = exported?.types[1]?.includes('.tsx') ? 'tsx' : 'ts'; - expect(exported.types).toEqual([`./dist/${p}/index.d.ts`, `./src/${p}/index.${extension}`]); - expect(exported.import).toEqual([`./dist/${p}/index.js`, `./src/${p}/index.${extension}`]); - expect(exported.default).toEqual([`./dist/${p}/index.js`, `./src/${p}/index.${extension}`]); + const extension = exported?.includes('.tsx') ? 'tsx' : 'ts'; + expect(exported).toEqual(`./src/${p}/index.${extension}`); + expect(rootIndexTs).toBeFalsy(); expect(rootIndexTs).toBeFalsy(); }); it('exports the package.json and phovea_registry', () => { - expect(packageJson.exports['./phovea_registry']).toEqual(['./dist/phovea_registry.js', './src/phovea_registry.ts']); + expect(packageJson.exports['./phovea_registry']).toEqual('./src/phovea_registry.ts'); expect(packageJson.exports['./package.json']).toBe('./package.json'); }); });