Skip to content

Commit bb2e04f

Browse files
authoredJul 1, 2024··
fix(testing): add testing sub module to export map (#5873)
* fix(testing): add testing sub module to export map * add require import for ./internal/client
1 parent dfbc340 commit bb2e04f

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed
 

‎package.json

+15-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
"types": "./internal/index.d.ts"
3838
},
3939
"./internal/client": {
40-
"import": "./internal/client/index.js"
40+
"import": "./internal/client/index.js",
41+
"require": "./internal/client/index.js"
4142
},
4243
"./internal/testing": {
43-
"import": "./internal/testing/index.js"
44+
"import": "./internal/testing/index.js",
45+
"require": "./internal/testing/index.js"
4446
},
4547
"./internal/testing/*": {
4648
"import": "./internal/testing/*"
@@ -61,7 +63,8 @@
6163
"types": "./compiler/stencil.d.ts"
6264
},
6365
"./compiler/*": {
64-
"import": "./compiler/*"
66+
"import": "./compiler/*",
67+
"types": "./compiler/*"
6568
},
6669
"./sys/node": {
6770
"import": "./sys/node/index.js",
@@ -71,6 +74,15 @@
7174
"./sys/node/*": {
7275
"import": "./sys/node/*",
7376
"require": "./sys/node/*"
77+
},
78+
"./testing": {
79+
"import": "./testing/index.js",
80+
"types": "./testing/index.d.ts",
81+
"require": "./testing/index.js"
82+
},
83+
"./testing/*": {
84+
"import": "./testing/*",
85+
"require": "./testing/*"
7486
}
7587
},
7688
"scripts": {

‎test/end-to-end/exportMap/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ const { h } = require('@stencil/core');
66
const { MockDocument } = require('@stencil/core/mock-doc');
77
const appData = require('@stencil/core/internal/app-data');
88
const { createNodeLogger } = require('@stencil/core/sys/node');
9+
const { createTesting } = require('@stencil/core/testing');
910

1011
assert(typeof version === 'string');
1112
assert(typeof run, 'function');
1213
assert(typeof h === 'function');
1314
assert(typeof MockDocument === 'function');
1415
assert(Object.keys(appData).length === 3);
1516
assert(typeof createNodeLogger === 'function');
17+
assert(typeof createTesting === 'function');
18+
19+
console.log(`🎉 All CJS imports successfully resolved!`);
20+
console.log('✅ passed!\n');

‎test/end-to-end/exportMap/index.mts

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
import assert from 'node:assert'
1+
import assert from 'node:assert';
22

3-
import { run } from '@stencil/core/cli'
4-
import { version } from '@stencil/core/compiler'
3+
import { run } from '@stencil/core/cli';
4+
import { version } from '@stencil/core/compiler';
55
import { MockDocument } from '@stencil/core/mock-doc';
66
import type { BuildConditionals } from '@stencil/core/internal';
7-
import { BUILD } from '@stencil/core/internal/app-data'
8-
import { createNodeLogger } from '@stencil/core/sys/node'
7+
import { BUILD } from '@stencil/core/internal/app-data';
8+
import { createNodeLogger } from '@stencil/core/sys/node';
9+
import { createTesting } from '@stencil/core/testing';
910

10-
assert(typeof version === 'string')
11-
version.slice()
12-
BUILD as BuildConditionals
11+
assert(typeof version === 'string');
12+
version.slice();
13+
BUILD as BuildConditionals;
1314

14-
assert(typeof run, 'function')
15-
run.call
15+
assert(typeof run, 'function');
16+
run.call;
1617

17-
assert(typeof MockDocument === 'function')
18-
assert(typeof BUILD !== 'undefined')
19-
assert(typeof createNodeLogger === 'function')
18+
assert(typeof MockDocument === 'function');
19+
assert(typeof BUILD !== 'undefined');
20+
assert(typeof createNodeLogger === 'function');
21+
assert(typeof createTesting === 'function');
22+
23+
console.log(`🎉 All ESM imports successfully resolved!`);
24+
console.log('✅ passed!\n');

0 commit comments

Comments
 (0)
Please sign in to comment.