Skip to content

Commit 6399038

Browse files
authored
test(harness): expose
1 parent 66577a4 commit 6399038

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test_harness/expose.cjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* @module expose.cjs
3+
*
4+
* @example expose.js/cjs
5+
* ```js
6+
* module.exports = {__dirname};
7+
* ```
8+
* @example use.mjs/esm
9+
* ```js
10+
* import expose from './expose.js';
11+
* const {__dirname} = expose;
12+
* ```
13+
*
14+
* @see {@link https://stackoverflow.com/a/46745166/10109857}
15+
*/
16+
17+
/**
18+
* returns the root package.json
19+
* @type {import('./types').PackageJson}
20+
*/
21+
const pkg = (() => require('../package.json'))();
22+
23+
/**
24+
* return's events
25+
* @returns {EventEmitter}
26+
*/
27+
function EventEmitterWrapper() {
28+
return require('../dist/index.cjs');
29+
}
30+
31+
module.exports = { dirname: __dirname, EventEmitterWrapper, pkg };

0 commit comments

Comments
 (0)