Skip to content

Commit

Permalink
Update test to fail on unset config.base
Browse files Browse the repository at this point in the history
This test times out on Vitest 1.0.2 without vitest-dev/vitest#4692
applied, and passes with it.

This is in response to:

- vitest-dev/vitest#4686 (comment)
  • Loading branch information
mbland committed Dec 7, 2023
1 parent 787ca46 commit 87eb6a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions demo.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
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 without https://github.com/vitest-dev/vitest/pull/4692
// even if config.base is overridden to be 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 87eb6a2

Please sign in to comment.