Skip to content

Commit

Permalink
test: move karma to playwright-test (#41)
Browse files Browse the repository at this point in the history
* test: move karma to playwright-test

* CI: update Node.js 18>=

* CI: update Node.js 18

* chore(deps): update mocha

* CI: update Node.js 18

* chore: update parcel

* CI: separate browser test

* CI: cleanup

* Ci: cache package

* fix

* CI: clean

* CI: clean

* CI: clean
  • Loading branch information
azu committed Jul 21, 2023
1 parent 23d364c commit ece957c
Show file tree
Hide file tree
Showing 18 changed files with 1,916 additions and 6,160 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"sandboxes": [
"/examples/basic"
],
"node": "14"
"node": "18"
}

61 changes: 56 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: test
on: [push, pull_request]
# disable saucelabs
#env:
# SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
# SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
permissions:
contents: read
jobs:
Expand All @@ -12,18 +8,73 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12,14,16]
node-version: [18, 20]
os: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install
- name: Build
run: yarn run build
- name: Test
run: yarn test

test-chrome:
name: "Test Chromium browser"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node.js
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: 18
- name: Install
run: yarn install
- name: Build
run: yarn run build
- name: Test
run: yarn run test:chrome

test-firefox:
name: "Test Firefox browser"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node.js
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: 18
- name: Install
run: yarn install
- name: Build
run: yarn run build
- name: Test
run: yarn run test:firefox

test-webkit:
name: "Test WebKit browser"
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup Node.js
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: 18
- name: Install
run: yarn install
- name: Build
run: yarn run build
- name: Test
run: yarn run test:webkit
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"start": "parcel serve index.html"
},
"dependencies": {
"@kvs/env": "^1.2.0"
"@kvs/env": "^2.1.3"
},
"devDependencies": {
"parcel": "^2.3.1",
"parcel": "^2.9.3",
"typescript": "^4.2.4"
},
"keywords": [],
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"build": "lerna run build",
"clean": "lerna run clean",
"test": "lerna run test && npm run size",
"test:chrome": "lerna run test:chrome",
"test:firefox": "lerna run test:firefox",
"test:webkit": "lerna run test:webkit",
"size": "size-limit",
"ci": "lerna run test --ignore '@kvs/localstorage'",
"versionup": "lerna version",
Expand Down
6 changes: 3 additions & 3 deletions packages/common-test-case/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"@kvs/types": "^2.1.1"
},
"devDependencies": {
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.1",
"mocha": "^9.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"mocha": "^10.2.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-node": "^10.2.1",
Expand Down
7 changes: 3 additions & 4 deletions packages/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@
"@kvs/node-localstorage": "^2.1.3"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.1",
"mocha": "^9.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"mocha": "^10.2.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
34 changes: 0 additions & 34 deletions packages/indexeddb/karma.conf.js

This file was deleted.

16 changes: 9 additions & 7 deletions packages/indexeddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
"clean": "rimraf lib/ module/",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prepublishOnly": "npm run clean && npm run build",
"test": "karma start --single-run"
"test": "tsc -p .",
"test:browser": "npm run test:chrome && npm run test:firefox && npm run test:webkit",
"test:chrome": "playwright-test ./test/index.test.ts --runner=mocha --browser=chromium",
"test:firefox": "playwright-test ./test/index.test.ts --runner=mocha --browser=firefox",
"test:webkit": "playwright-test ./test/index.test.ts --runner=mocha --browser=webkit"
},
"prettier": {
"printWidth": 120,
Expand All @@ -48,13 +52,11 @@
"@kvs/types": "^2.1.1"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@kvs/common-test-case": "^2.1.3",
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.1",
"karma": "^6.3.4",
"karma-cli": "^2.0.0",
"mocha": "^9.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"mocha": "^10.2.0",
"playwright-test": "^12.1.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
34 changes: 0 additions & 34 deletions packages/localstorage/karma.conf.js

This file was deleted.

16 changes: 9 additions & 7 deletions packages/localstorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
"clean": "rimraf lib/ module/",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prepublishOnly": "npm run clean && npm run build",
"test": "karma start --single-run",
"test": "tsc -p .",
"test:browser": "npm run test:chrome && npm run test:firefox && npm run test:webkit",
"test:chrome": "playwright-test ./test/index.test.ts --runner=mocha --browser=chromium",
"test:firefox": "playwright-test ./test/index.test.ts --runner=mocha --browser=firefox",
"test:webkit": "playwright-test ./test/index.test.ts --runner=mocha --browser=webkit",
"watch": "tsc -p . --watch"
},
"prettier": {
Expand All @@ -48,12 +52,10 @@
"@kvs/storage": "^2.1.3"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.1",
"karma": "^6.3.4",
"karma-cli": "^2.0.0",
"mocha": "^9.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"mocha": "^10.2.0",
"playwright-test": "^12.1.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/memorystorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@
"trailingComma": "none"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@kvs/common-test-case": "^2.1.3",
"@types/mocha": "^9.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^16.9.1",
"mocha": "^9.1.1",
"mocha": "^10.2.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/node-localstorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@
"node-localstorage": "^2.1.6"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@kvs/common-test-case": "^2.1.3",
"@types/mocha": "^9.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^16.9.1",
"mocha": "^9.1.1",
"mocha": "^10.2.0",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
34 changes: 0 additions & 34 deletions packages/storage-sync/karma.conf.js

This file was deleted.

16 changes: 9 additions & 7 deletions packages/storage-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
"clean": "rimraf lib/ module/",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prepublishOnly": "npm run clean && npm run build",
"test": "karma start --single-run",
"test": "tsc -p .",
"test:browser": "npm run test:chrome && npm run test:firefox && npm run test:webkit",
"test:chrome": "playwright-test ./test/index.test.ts --runner=mocha --browser=chromium",
"test:firefox": "playwright-test ./test/index.test.ts --runner=mocha --browser=firefox",
"test:webkit": "playwright-test ./test/index.test.ts --runner=mocha --browser=webkit",
"watch": "tsc -p . --watch"
},
"prettier": {
Expand All @@ -48,13 +52,11 @@
"@kvs/types": "^2.1.1"
},
"devDependencies": {
"@jsdevtools/karma-config": "^3.1.7",
"@kvs/common-test-case": "^2.1.3",
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.1",
"karma": "^6.3.4",
"karma-cli": "^2.0.0",
"mocha": "^9.1.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"mocha": "^10.2.0",
"playwright-test": "^12.1.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"ts-loader": "^8.2.0",
Expand Down
Loading

0 comments on commit ece957c

Please sign in to comment.