Skip to content

Commit 9259fc0

Browse files
committed
test: add e2e
1 parent 214bc3c commit 9259fc0

14 files changed

Lines changed: 1812 additions & 46 deletions

File tree

.github/workflows/dev.yml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- dev
7+
- feat-dnr
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
@@ -50,39 +51,44 @@ jobs:
5051
with:
5152
name: bundle-analyze
5253
path: temp/bundle-analyze.html
53-
- name: Publish snapshot
54-
env:
55-
AMO_KEY: ${{ secrets.AMO_KEY }}
56-
AMO_SECRET: ${{ secrets.AMO_SECRET }}
57-
CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
58-
CRX_PRIV_KEY_V3: ${{ secrets.CRX_PRIV_KEY_V3 }}
59-
PACK_PLATFORM: xpi,crx
60-
run: npm run pack
61-
- name: Upload snapshot release
62-
uses: actions/upload-artifact@v3
63-
with:
64-
name: release
65-
path: |
66-
temp/release
67-
!temp/release/*-id.txt
54+
- name: Test
55+
run: |
56+
php -S 0.0.0.0:8899 -t $GITHUB_WORKSPACE/tests/simple-server &
57+
sleep 5
58+
npm run test:e2e
59+
# - name: Publish snapshot
60+
# env:
61+
# AMO_KEY: ${{ secrets.AMO_KEY }}
62+
# AMO_SECRET: ${{ secrets.AMO_SECRET }}
63+
# CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
64+
# CRX_PRIV_KEY_V3: ${{ secrets.CRX_PRIV_KEY_V3 }}
65+
# PACK_PLATFORM: xpi,crx
66+
# run: npm run pack
67+
# - name: Upload snapshot release
68+
# uses: actions/upload-artifact@v3
69+
# with:
70+
# name: release
71+
# path: |
72+
# temp/release
73+
# !temp/release/*-id.txt
6874

69-
sync-locale:
70-
runs-on: ubuntu-24.04
71-
strategy:
72-
matrix:
73-
node-version: [16.x]
74-
steps:
75-
- uses: actions/checkout@v3
76-
- name: Use Node.js ${{ matrix.node-version }}
77-
uses: actions/setup-node@v3
78-
with:
79-
node-version: ${{ matrix.node-version }}
80-
- name: Sort
81-
run: node ./locale/sort-origin.js
82-
- name: Deploy
83-
uses: JamesIves/github-pages-deploy-action@v4
84-
with:
85-
branch: sync-locale
86-
folder: locale
87-
clean: false
88-
commit-message: '[skip ci] sync locale'
75+
# sync-locale:
76+
# runs-on: ubuntu-24.04
77+
# strategy:
78+
# matrix:
79+
# node-version: [16.x]
80+
# steps:
81+
# - uses: actions/checkout@v3
82+
# - name: Use Node.js ${{ matrix.node-version }}
83+
# uses: actions/setup-node@v3
84+
# with:
85+
# node-version: ${{ matrix.node-version }}
86+
# - name: Sort
87+
# run: node ./locale/sort-origin.js
88+
# - name: Deploy
89+
# uses: JamesIves/github-pages-deploy-action@v4
90+
# with:
91+
# branch: sync-locale
92+
# folder: locale
93+
# clean: false
94+
# commit-message: '[skip ci] sync locale'

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ encrypt
4646
temp
4747

4848
manifest.json
49-
dist_*
49+
dist_*
50+
tests/**/config.json

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build/
2-
tests/
32
demo/
43
.ice/
54
coverage/

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"stylelint": "stylelint \"**/*.{css,scss,less}\"",
2222
"release": "node ./scripts/release.mjs",
2323
"pack": "node ./scripts/pack.mjs",
24-
"test:e2e": "jest --config ./test/e2e/jest.config.json"
24+
"test:e2e": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --config ./tests/e2e/jest.config.json"
2525
},
2626
"dependencies": {
2727
"@codemirror/lang-javascript": "^6.1.4",
@@ -67,6 +67,7 @@
6767
"eslint-plugin-import": "^2.27.5",
6868
"eslint-plugin-unused-imports": "^2.0.0",
6969
"fs-extra": "^11.1.1",
70+
"get-port": "^7.1.0",
7071
"husky": "^3.1.0",
7172
"ice.js": "^2.0.0",
7273
"jest": "^29.7.0",
@@ -79,6 +80,7 @@
7980
"sign-addon": "^6.0.0",
8081
"stylelint": "^13.7.2",
8182
"typescript": "^4.9.5",
83+
"web-ext": "^8.6.0",
8284
"webpack-bundle-analyzer": "^4.8.0"
8385
},
8486
"husky": {

0 commit comments

Comments
 (0)