Skip to content

Commit e99f28a

Browse files
committed
Add tests for exposed identifiers
1 parent a4fc6d2 commit e99f28a

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/core.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ process.on('exit', async () => {
1919
try {
2020
// Has to be sync.
2121
renameSync('package.json.bak', 'package.json')
22-
} catch (/** @type {any} */ error) {
23-
// ignore if not found, which will happen because baseline.js sometimes skips the test
24-
if (error.code !== 'ENOENT') throw error
22+
} catch (error) {
23+
const exception = /** @type {ErrnoException} */ (error)
24+
// ignore if not found, which will happen because baseline.js sometimes
25+
// skips the test.
26+
if (exception.code !== 'ENOENT') throw error
2527
}
2628
})
2729

test/ponyfill.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {resolve} from '../index.js'
44

5-
test('ponyfill', function () {
5+
test('ponyfill', async function () {
6+
assert.deepEqual(
7+
Object.keys(await import('import-meta-resolve')).sort(),
8+
['moduleResolve', 'resolve'],
9+
'should expose the public api'
10+
)
11+
612
try {
713
// @ts-expect-error
814
resolve('x')

0 commit comments

Comments
 (0)