Skip to content

Commit aba6b3a

Browse files
committed
fix: restore package export-map contract test
This test validates the package.json exports field, not runtime code. Its Istanbul fingerprint is empty, making it trivially "subsumed" by the coverage analysis — but no integration test checks the export map.
1 parent f31f7aa commit aba6b3a

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import fs from 'node:fs';
2+
import path from 'node:path';
3+
import { test } from 'vitest';
4+
import assert from 'node:assert/strict';
5+
6+
test('package exports only supported public subpaths', () => {
7+
const pkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8')) as {
8+
exports: Record<string, unknown>;
9+
};
10+
11+
const supportedSubpaths = [
12+
'.',
13+
'./io',
14+
'./artifacts',
15+
'./metro',
16+
'./batch',
17+
'./remote-config',
18+
'./install-source',
19+
'./android-adb',
20+
'./android-snapshot-helper',
21+
'./contracts',
22+
'./selectors',
23+
'./finders',
24+
];
25+
26+
for (const subpath of supportedSubpaths) {
27+
assert.equal(pkg.exports[subpath] !== undefined, true, `${subpath} should be exported`);
28+
}
29+
30+
assert.equal(pkg.exports['./android-apps'], undefined);
31+
assert.equal(pkg.exports['./daemon'], undefined);
32+
});

0 commit comments

Comments
 (0)