Skip to content

Commit 0226df4

Browse files
committed
fixup: fixes
1 parent 32bb7a3 commit 0226df4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/svelte/src/vitest.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { act, cleanup, setup } from '@testing-library/svelte'
22
import { beforeEach } from 'vitest'
33

4+
const afterEach = async () => {
5+
await act()
6+
cleanup()
7+
}
8+
49
beforeEach(() => {
510
setup()
6-
7-
return async () => {
8-
await act()
9-
cleanup()
10-
}
11+
return afterEach
1112
})

tests/cleanup.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('cleanup', () => {
2727
throw new Error('oh no!')
2828
})
2929

30-
expect(renderSubject).toThrowError()
30+
expect(renderSubject).toThrow()
3131
cleanup()
3232

3333
expect(document.body).toBeEmptyDOMElement()

0 commit comments

Comments
 (0)