Skip to content

Commit

Permalink
wip: test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Oct 20, 2023
1 parent 6a48986 commit 4cd26b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node_version: [16, 18, 20]
include:
# Active LTS + other OS
- os: macos-latest
node_version: 18
- os: windows-latest
node_version: 18
fail-fast: false
# node_version: [16, 18, 20]
node_version: [18]
# include:
# # Active LTS + other OS
# - os: macos-latest
# node_version: 18
# - os: windows-latest
# node_version: 18
fail-fast: true

steps:
- name: Checkout
Expand Down
21 changes: 13 additions & 8 deletions playground/spa/__tests__/spa.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ describe('console', async () => {
describe('hmr', () => {
test.runIf(isServe)('should trigger hmr', async () => {
const u = 'hmr-updated'
expect(page.textContent('#hmr'), 'hmr original text')

await untilUpdated(() => page.textContent('#hmr'), 'hmr original text')
await untilBrowserLogAfter(
() => editFile('public-typescript/hmr.ts', (code) => code.replace('hmr original text', u)),
['[vite] hot updated: /src/App.tsx'],
false,
(l) => console.log(l, 'l'),
)
await untilUpdated(() => page.textContent('#hmr'), u)
// await untilBrowserLogAfter(
// () => editFile('public-typescript/hmr.ts', (code) => code.replace('hmr original text', u)),
// ['[vite] hot updated: /src/App.tsx'],
// false,
// (l) => console.log(l, 'l'),
// )

editFile('public-typescript/hmr.ts', (code) => code.replace('hmr original text', u))

expect(browserLogs).toContain('[vite] hot updated: /src/App.tsx')

expect(page.textContent('#hmr'), u)
})
})

Expand Down

0 comments on commit 4cd26b5

Please sign in to comment.