Skip to content

Commit 93ee27c

Browse files
GeekyDeaksisaacs
authored andcommitted
expose tap/mocha
Fix: #818 PR-URL: #822 Credit: @GeekyDeaks Close: #822 Reviewed-by: @isaacs
1 parent 73e3f7e commit 93ee27c

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"default": "./lib/tap.js"
1515
},
1616
"./*": "./*",
17-
"./": "./"
17+
"./": "./",
18+
"./mocha": "./lib/mocha.js"
1819
},
1920
"engines": {
2021
"node": ">=12"

tap-snapshots/test/test.mjs.test.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8+
exports[`test/test.mjs TAP mocha export > must match snapshot 1`] = `
9+
Array [
10+
"after",
11+
"afterEach",
12+
"before",
13+
"beforeEach",
14+
"context",
15+
"default",
16+
"deglobal",
17+
"describe",
18+
"global",
19+
"it",
20+
"specify",
21+
]
22+
`
23+
824
exports[`test/test.mjs TAP tap > must match snapshot 1`] = `
925
Array [
1026
"Spawn",

test/test.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (typeof createRequire !== 'function') {
1010
process.exit(0)
1111
}
1212

13-
const require = createRequire(import.meta.url);
13+
const require = createRequire(import.meta.url)
1414

1515
const cjs = require('tap');
1616

@@ -23,3 +23,11 @@ t.test('tap', async t => {
2323
t.equal(tap[key], key === 'default' ? cjs : cjs[key], key)
2424
}
2525
})
26+
27+
import * as mocha from 'tap/mocha'
28+
t.test('mocha export', async t => {
29+
t.matchSnapshot(Object.keys(mocha).sort())
30+
for (const key of Object.keys(mocha)) {
31+
t.equal(mocha[key], key === 'default' ? cjs.mocha : cjs.mocha[key], key)
32+
}
33+
})

0 commit comments

Comments
 (0)