Skip to content

Commit f35d4aa

Browse files
committed
fix: test case
1 parent 64d773e commit f35d4aa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/inpage/setup-inpage-provider.test.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import {expect, describe, it, vi} from 'vitest'
1+
import {expect, describe, it, vi, beforeEach} from 'vitest'
22
import {EIP6963EventNames} from './eip-6963.js'
3+
4+
beforeEach(async () => {
5+
window.ethereum = 1
6+
})
7+
38
describe('inpage', () => {
49
describe('setupProvider', () => {
510
it('should setup the provider on window.conflux', async () => {
@@ -16,9 +21,9 @@ describe('inpage', () => {
1621
expect(eventNames[1]).toBe(EIP6963EventNames.Request)
1722
expect(window.conflux).toBeDefined()
1823
})
19-
24+
})
25+
describe('setupProvider', () => {
2026
it('should not setup the provider on window.ethereum when already defined', async () => {
21-
window.ethereum = 1
2227
expect(window.ethereum).toBe(1)
2328
await import('./index.js')
2429
expect(window.ethereum).toBe(1)

0 commit comments

Comments
 (0)