Skip to content

Commit

Permalink
update types for Ava 4
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 26, 2022
1 parent 8f72072 commit c50ea93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions packages/run-protocol/test/psm/test-psm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { makeTracer } from '../../src/makeTracer.js';
import { unsafeMakeBundleCache } from '../bundleTool.js';
import { setUpZoeForTest } from '../supports.js';

/** @type {import('ava').TestInterface<Awaited<ReturnType<makeTestContext>>>} */
// @ts-expect-error cast
/** @type {import('ava').TestFn<Awaited<ReturnType<makeTestContext>>>} */
const test = anyTest;

const pathname = new URL(import.meta.url).pathname;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init';
// eslint-disable-next-line import/no-extraneous-dependencies
import rawTest from 'ava';
import anyTest from 'ava';
import { buildVatController, buildKernelBundles } from '@agoric/swingset-vat';
import bundleSource from '@endo/bundle-source';
import { E } from '@endo/eventual-send';
Expand All @@ -17,9 +15,8 @@ import { unsafeMakeBundleCache } from '../../bundleTool.js';

const dirname = new URL('.', import.meta.url).pathname;

/** @type {import('ava').TestInterface<{ data: { kernelBundles: any, config: any } }>} */
// @ts-expect-error cast
const test = rawTest;
/** @type {import('ava').TestFn<{ data: { kernelBundles: any, config: any } }>} */
const test = anyTest;

test.before(async t => {
const kernelBundles = await buildKernelBundles();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-check

// eslint-disable-next-line import/no-extraneous-dependencies
import '@endo/init';
// eslint-disable-next-line import/no-extraneous-dependencies
import rawTest from 'ava';
import anyTest from 'ava';
import path from 'path';
import { buildVatController, buildKernelBundles } from '@agoric/swingset-vat';
import bundleSource from '@endo/bundle-source';
Expand All @@ -17,9 +15,8 @@ import liquidateMinimumBundle from '../../../bundles/bundle-liquidateMinimum.js'
import ammBundle from '../../../bundles/bundle-amm.js';
import vaultFactoryBundle from '../../../bundles/bundle-vaultFactory.js';

/** @type {import('ava').TestInterface<{ data: { kernelBundles: any, config: any } }>} */
// @ts-expect-error cast
const test = rawTest;
/** @type {import('ava').TestFn<{ data: { kernelBundles: any, config: any } }>} */
const test = anyTest;

/**
*
Expand Down
1 change: 1 addition & 0 deletions packages/run-protocol/test/vaultFactory/test-storeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ for (const [debt, collat, vaultId, expectedKey, numberOut] of [
AmountMath.make(mockBrand, BigInt(collat)),
String(vaultId),
);
// @ts-expect-error TODO use macros
t.is(key, expectedKey);
t.deepEqual(StoreUtils.fromVaultKey(key), [numberOut, vaultId]);
});
Expand Down

0 comments on commit c50ea93

Please sign in to comment.