Skip to content

Commit 076bfa9

Browse files
authored
feat: enable esm import (#713)
1 parent 2e0fdb4 commit 076bfa9

37 files changed

Lines changed: 11429 additions & 234 deletions

.circleci/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
# lerna link after installing the latest version of chromedriver, as we depend on webdriverJS
131131
- run: cd packages/cli && npx lerna link
132132
- run: npm run coverage --prefix=packages/cli
133+
- run: npm run test:esm --prefix=packages/cli
133134

134135
puppeteer:
135136
<<: *defaults
@@ -143,6 +144,7 @@ jobs:
143144
- run: sudo apt-get update -y
144145
- run: cd packages/puppeteer && npx browser-driver-manager@1.0.4 install chrome chromedriver --verbose
145146
- run: npm run coverage --prefix=packages/puppeteer
147+
- run: npm run test:esm --prefix=packages/puppeteer
146148

147149
webdriverjs:
148150
<<: *defaults
@@ -156,6 +158,10 @@ jobs:
156158
command: npm run coverage --prefix=packages/webdriverjs
157159
environment:
158160
CHROMEDRIVER_PATH: /usr/local/bin/chromedriver
161+
- run:
162+
command: npm run test:esm --prefix=packages/webdriverjs
163+
environment:
164+
CHROMEDRIVER_PATH: /usr/local/bin/chromedriver
159165

160166
webdriverio:
161167
<<: *defaults
@@ -165,17 +171,23 @@ jobs:
165171
- restore_dependency_cache
166172
- browser-tools/install-chrome
167173
- browser-tools/install-chromedriver
174+
- run: npm run build --prefix=packages/webdriverio
168175
- run:
169176
command: npm run coverage --prefix=packages/webdriverio
170177
environment:
171178
CHROMEDRIVER_PATH: /usr/local/bin/chromedriver
179+
- run:
180+
command: npm run test:esm --prefix=packages/webdriverio
181+
environment:
182+
CHROMEDRIVER_PATH: /usr/local/bin/chromedriver
172183

173184
reporter-earl:
174185
<<: *defaults
175186
steps:
176187
- checkout
177188
- restore_dependency_cache
178189
- run: npm run test --prefix=packages/reporter-earl
190+
- run: npm run test:esm --prefix=packages/reporter-earl
179191

180192
react:
181193
<<: *defaults
@@ -184,6 +196,7 @@ jobs:
184196
- restore_dependency_cache
185197
- run: npm run build --prefix=packages/react
186198
- run: npm run test --prefix=packages/react
199+
- run: npm run test:esm --prefix=packages/react
187200

188201
playwright:
189202
docker:
@@ -200,6 +213,7 @@ jobs:
200213
- run: npm run bootstrap -- --ci
201214
- run: npm run build --prefix=packages/playwright
202215
- run: npm run coverage --prefix=packages/playwright
216+
- run: npm run test:esm --prefix=packages/playwright
203217

204218
axe-core-test:
205219
<<: *defaults

packages/cli/esmTest.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { testPages } from './dist/index.mjs';
2+
import assert from 'assert';
3+
4+
const exportIsFunction = typeof(testPages) === 'function';
5+
assert(exportIsFunction, 'export is not a function');
6+

0 commit comments

Comments
 (0)