Skip to content

chore(deps): update dependency vitest to v3 #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"eslint-plugin-prettier": "5.2.1",
"prettier": "3.4.2",
"vite": "6.0.7",
"vite-plugin-solid": "2.11.0",
"vitest": "2.1.8",
"vite-plugin-solid": "^2.11.1",
"vitest": "3.0.9",
"vue-demi": "0.14.10"
}
}
6 changes: 6 additions & 0 deletions packages/use-wallet-solid/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import solidPlugin from 'vite-plugin-solid'
import { defineConfig, mergeConfig } from 'vitest/config'
import viteConfig from './vite.config'

export default mergeConfig(
viteConfig,
defineConfig({
plugins: [
solidPlugin({
ssr: false
})
],
test: {
name: 'use-wallet-solid',
dir: './src',
Expand Down
14 changes: 7 additions & 7 deletions packages/use-wallet/src/__tests__/wallets/lute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StorageAdapter } from 'src/storage'
import { LOCAL_STORAGE_KEY, State, WalletState, DEFAULT_STATE } from 'src/store'
import { byteArrayToBase64 } from 'src/utils'
import { LuteWallet } from 'src/wallets/lute'
import { SignTxnsError, WalletId } from 'src/wallets/types'
import { WalletId } from 'src/wallets/types'
import type { Mock } from 'vitest'

// Mock logger
Expand Down Expand Up @@ -253,15 +253,15 @@ describe('LuteWallet', () => {

describe('signTransactions', () => {
it('should re-throw SignTxnsError to the consuming application', async () => {
const mockSignTxns = vi.fn().mockRejectedValue({
const mockError = Object.assign(new Error('User Rejected Request'), { code: 4001 })
const mockSignTxns = vi.fn().mockRejectedValue(mockError)
vi.mocked(mockLuteConnect.signTxns).mockImplementation(mockSignTxns)

await expect(wallet.signTransactions([txn1])).rejects.toMatchObject({
name: 'SignTxnsError',
message: 'User Rejected Request',
code: 4001
})
vi.mocked(mockLuteConnect.signTxns).mockImplementation(mockSignTxns)

await expect(wallet.signTransactions([txn1])).rejects.toThrow(
new SignTxnsError('User Rejected Request', 4001)
)
})

it('should process and sign a single algosdk.Transaction', async () => {
Expand Down
Loading