Skip to content

Commit

Permalink
fix: support and test ESM consumers (#94)
Browse files Browse the repository at this point in the history
* chore: test exports on nodejs matrix

* fix: esm imports

* chore: remove is-ci

* chore: use ts 4.7.4

* chore: move files around

* fix: use esm imports

* chore: move cli-related modules to ./bin

* chore: fixing nodejs14 tests

* chore: update readme [skip ci]

* chore: fix publish script [skip ci]
  • Loading branch information
agoldis committed Mar 19, 2023
1 parent 38abad1 commit 78d5709
Show file tree
Hide file tree
Showing 45 changed files with 1,024 additions and 198 deletions.
3 changes: 2 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Integrate Cypress with alternative cloud services like Currents or Sorry Cypress

## Requirements

The package requires cypress version 10+ and NodeJS 14.7.0+
- Cypress version 10+
- NodeJS 14.7.0+

## Setup

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/e2e-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ on:
push:

jobs:
e2e-smoke:
e2e-exports:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

services:
director:
image: agoldis/sorry-cypress-director
ports:
- 1234:1234
strategy:
matrix:
node-version: ["18", "16", "14"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: ${{ matrix.node-version }}

- name: Install npm (node14)
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci
Expand All @@ -32,6 +33,6 @@ jobs:
run: npm install

- name: Test Exports
working-directory: ./examples/exports
working-directory: ./e2e/exports
run: |
npm run testexports
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Attach",
"port": 9778,
"port": 9229,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node"
Expand Down
14 changes: 8 additions & 6 deletions examples/exports/package.json → e2e/exports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
"private": true,
"scripts": {
"testexports": "concurrently \"npm:test:*\"",
"test:run:cjs": "node ./run.cjs.js",
"test:run:esm": "ts-node ./run.esm.ts",
"test:plugin:esm": "ts-node ./plugin.esm.ts",
"test:plugin:cjs": "node ./plugin.cjs.js"
"test:run:cjs": "node ./run.js",
"test:run:ts": "ts-node ./run.ts",
"test:run:mjs": "node ./run.mjs",
"test:plugin:ts": "ts-node ./plugin.ts",
"test:plugin:cjs": "node ./plugin.js",
"test:plugin:mjs": "node ./plugin.mjs"
},
"dependencies": {
"cypress-cloud": "*"
},
"devDependencies": {
"@types/node": "^17.0.12",
"concurrently": "^7.6.0",
"eslint-config-custom": "*",
"eslint-config-custom": "latest",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typescript": "^4.5.3"
"typescript": "^4.7.4"
}
}
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions e2e/exports/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import assert from "assert";
import cloudPluginDefault, { cloudPlugin } from "cypress-cloud/plugin";

assert(typeof cloudPluginDefault === "function");
assert(typeof cloudPlugin === "function");
assert(cloudPluginDefault === cloudPlugin);
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions e2e/exports/run.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import assert from "assert";
import { run } from "cypress-cloud";

assert(typeof run === "function");
4 changes: 2 additions & 2 deletions examples/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"eslint": "7.32.0",
"eslint-config-custom": "*",
"eslint-config-custom": "latest",
"tsconfig": "*",
"typescript": "^4.5.3"
"typescript": "^4.7.4"
}
}
Loading

0 comments on commit 78d5709

Please sign in to comment.