Skip to content

Commit

Permalink
Update test to fail on unset config.base
Browse files Browse the repository at this point in the history
`pnpm test:workaround`, which deletes config.base, will now timeout.

This is in response to:

- vitest-dev/vitest#4686 (comment)
  • Loading branch information
mbland committed Dec 7, 2023
1 parent 787ca46 commit 1855ea2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions demo.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import { test } from 'vitest'
import { expect, test } from 'vitest'

test('OK in <=1.0.0-beta.4+vite <=5.0.0-beta.7, breaks otherwise', () => null)
test('OK in <=1.0.0-beta.4+vite <=5.0.0-beta.7, breaks otherwise', async () => {
// This will timeout when config.base is undefined.
var page = window.open('/foobar/hello.html')
await new Promise(resolve => page.addEventListener('load', resolve))

let e = page.document.querySelector('body p')

expect(e.textContent).toContain('Hello, World!')
})
File renamed without changes.

0 comments on commit 1855ea2

Please sign in to comment.