Skip to content

Commit

Permalink
test: use ava@6
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Jun 12, 2024
1 parent d872b53 commit 3b72fef
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 692 deletions.
2 changes: 1 addition & 1 deletion multichain-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/node": "^20.11.13",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"ava": "^5.3.0",
"ava": "^6.1.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
9 changes: 3 additions & 6 deletions multichain-testing/test/tools/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ test('create a wallet and get tokens', async t => {

const bondDenom =
useChain('osmosis').chain.staking?.staking_tokens?.[0].denom;
if (!bondDenom) {
t.fail('Bond denom not found.');
} else {
const { balance } = await queryClient.queryBalance(addr, bondDenom);
t.deepEqual(balance, { denom: bondDenom, amount: '10000000000' });
}
t.truthy(bondDenom, 'bond denom found');
const { balance } = await queryClient.queryBalance(addr, bondDenom!);
t.deepEqual(balance, { denom: bondDenom, amount: '10000000000' });
});
6 changes: 2 additions & 4 deletions multichain-testing/tools/sleep.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { LogFn } from 'ava';
type Log = (...values: unknown[]) => void;

type NoOpFn = () => void;

export const sleep = (ms: number, log: LogFn | NoOpFn = () => {}) =>
export const sleep = (ms: number, log: Log = () => {}) =>
new Promise(resolve => {
log(`Sleeping for ${ms}ms...`);
setTimeout(resolve, ms);
Expand Down
Loading

0 comments on commit 3b72fef

Please sign in to comment.