Skip to content

Commit c534373

Browse files
ci(github): add UMD page test to workflow test.yml (#2308)
* ci(github): add UMD page test to workflow test.yml - Add `page-test-action` step to test the UMD example page - Start a local Python HTTP server on port 8000 - Navigate to `http://localhost:8000/examples/script` and check for errors * style(attributes-to-props): fix prettier lint
1 parent 0623ccd commit c534373

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ permissions: read-all
66
jobs:
77
unit:
88
runs-on: ubuntu-latest
9-
109
steps:
1110
- name: Checkout repository
1211
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -39,7 +38,6 @@ jobs:
3938
strategy:
4039
matrix:
4140
browser: [chromium, firefox, webkit]
42-
4341
steps:
4442
- name: Checkout repository
4543
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -58,3 +56,28 @@ jobs:
5856

5957
- name: Run browser tests on ${{ matrix.browser }}
6058
run: npm test -- --config=vitest.config.browser.mts --browser=${{ matrix.browser }}
59+
60+
e2e:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout repository
64+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
65+
66+
- name: Use Node.js
67+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
68+
with:
69+
cache: npm
70+
node-version-file: .nvmrc
71+
72+
- name: Install dependencies
73+
run: npm ci --prefer-offline
74+
75+
- name: Build package
76+
run: npm run build
77+
78+
- name: Test UMD page
79+
uses: remarkablemark/page-test-action@501177ce8d124eff6bc5e7b930a3dbd62f28a173 # v1.0.6
80+
with:
81+
url: http://localhost:8000/examples/script
82+
start: python3 -m http.server
83+
wait-on: http://localhost:8000

‎src/attributes-to-props.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ export default function attributesToProps(
6767

6868
if (propName) {
6969
const propertyInfo = getPropertyInfo(propName) as
70-
| { type: number }
71-
| undefined;
70+
{ type: number } | undefined;
7271

7372
// convert attribute to uncontrolled component prop (e.g., `value` to `defaultValue`)
7473
if (

0 commit comments

Comments
 (0)