Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Oct 21, 2024
1 parent a034547 commit f490398
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions packages/core/src/createConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,29 +361,6 @@ test('behavior: setup connector', async () => {
})

test('behavior: eip 6963 providers', async () => {
vi.mock(import('mipd'), async (importOriginal) => {
const mod = await importOriginal()

let _cache: typeof mod | undefined
if (!_cache)
_cache = {
...mod,
createStore() {
const store = mod.createStore()
return {
...store,
getProviders() {
return [
getProviderDetail({ name: 'Example', rdns: 'com.example' }),
getProviderDetail({ name: 'Mock', rdns: 'com.mock' }),
]
},
}
},
}
return _cache
})

const detail_1 = getProviderDetail({ name: 'Foo Wallet', rdns: 'com.foo' })
const detail_2 = getProviderDetail({ name: 'Bar Wallet', rdns: 'com.bar' })
const detail_3 = getProviderDetail({ name: 'Mock', rdns: 'com.mock' })
Expand Down Expand Up @@ -435,3 +412,26 @@ function getProviderDetail(
provider: `<EIP1193Provider_${info.rdns}>` as unknown as EIP1193Provider,
}
}

vi.mock(import('mipd'), async (importOriginal) => {
const mod = await importOriginal()

let _cache: typeof mod | undefined
if (!_cache)
_cache = {
...mod,
createStore() {
const store = mod.createStore()
return {
...store,
getProviders() {
return [
getProviderDetail({ name: 'Example', rdns: 'com.example' }),
getProviderDetail({ name: 'Mock', rdns: 'com.mock' }),
]
},
}
},
}
return _cache
})

0 comments on commit f490398

Please sign in to comment.