Skip to content

Commit c9a49eb

Browse files
committed
test: add some basic tests to confirm exports are correct
1 parent 99a4c2b commit c9a49eb

5 files changed

Lines changed: 759 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535

3636
- name: Build
3737
run: pnpm build:prod_publish
38+
39+
- name: Test exports
40+
run: pnpm test:exports

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ jobs:
3737

3838
- name: Set build environment variables
3939
run: |
40+
echo "IS_RELEASE=true" >> $GITHUB_ENV
4041
echo "BUILD_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
4142
echo "BUILD_DATE=$(date -u +%Y-%m-%d)" >> $GITHUB_ENV
4243
4344
- name: Build
4445
run: pnpm build:prod_publish
4546

47+
- name: Test exports
48+
run: pnpm test:exports
49+
4650
- name: Publish to npm
4751
run: pnpm publish --no-git-checks --provenance
4852

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"prebuild": "npm-run-all clean:*",
7272
"test:mocha": "npm-run-all clean:compiled && tsc -p tsconfig.umd.json --target ES6 && nyc mocha --reporter mochawesome --exit",
7373
"test:wct": "ws -o",
74+
"test:exports": "vitest run tests/exports.test.ts",
7475
"wct:report": "echo '🚀 Starting server and opening test page...' && (ws > /dev/null 2>&1 &) && sleep 3 && open http://localhost:8000/wct_tests/run-all-with-report.html && echo '✅ Page opened! Wait for tests to complete, then click the green button to download report.'",
7576
"eslint": "eslint . --ext .ts"
7677
},
@@ -129,6 +130,7 @@
129130
"typedoc": "0.25.2",
130131
"typescript": "^6.0.0",
131132
"url-loader": "^4.1.1",
133+
"vitest": "^4.1.2",
132134
"webpack": "^5.74.0",
133135
"webpack-cli": "^4.10.0",
134136
"webpack-merge": "^4.2.1",
@@ -142,4 +144,4 @@
142144
"engines": {
143145
"node": ">=20.4.0"
144146
}
145-
}
147+
}

0 commit comments

Comments
 (0)