diff --git a/packages/boot/test/bootstrapTests/liquidation.js b/packages/boot/test/bootstrapTests/liquidation.js index 647988311b7..6eabe517aec 100644 --- a/packages/boot/test/bootstrapTests/liquidation.js +++ b/packages/boot/test/bootstrapTests/liquidation.js @@ -40,14 +40,15 @@ export const makeLiquidationTestContext = async t => { // has to be late enough for agoricNames data to have been published /** @type {import('@agoric/vats/tools/board-utils.js').AgoricNamesRemotes} */ - const agoricNamesRemotes = {}; + const agoricNamesRemotes = makeAgoricNamesRemotesFromFakeStorage( + swingsetTestKit.storage, + ); const refreshAgoricNamesRemotes = () => { Object.assign( agoricNamesRemotes, makeAgoricNamesRemotesFromFakeStorage(swingsetTestKit.storage), ); }; - refreshAgoricNamesRemotes(); agoricNamesRemotes.brand.ATOM || Fail`ATOM missing from agoricNames`; console.timeLog('DefaultTestContext', 'agoricNamesRemotes'); diff --git a/packages/boot/test/bootstrapTests/test-vaults-integration.js b/packages/boot/test/bootstrapTests/test-vaults-integration.js index 3263f6a1f97..36f11834e25 100644 --- a/packages/boot/test/bootstrapTests/test-vaults-integration.js +++ b/packages/boot/test/bootstrapTests/test-vaults-integration.js @@ -266,7 +266,7 @@ test('exit bid', async t => { giveCollateral: 9.0, }); - wd.sendOfferMaker(Offers.auction.Bid, { + await wd.sendOfferMaker(Offers.auction.Bid, { offerId: 'bid', maxBuy: '1.23ATOM', give: '0.1IST', diff --git a/packages/boot/test/bootstrapTests/test-zcf-upgrade.js b/packages/boot/test/bootstrapTests/test-zcf-upgrade.js index 669e8a0d5c2..b25aa1165a1 100644 --- a/packages/boot/test/bootstrapTests/test-zcf-upgrade.js +++ b/packages/boot/test/bootstrapTests/test-zcf-upgrade.js @@ -157,7 +157,7 @@ test('run restart-vats proposal', async t => { await buildAndExecuteProposal(zcfPackageSpec); t.log('upgrade zoe&zcf proposal executed'); - zoeDriver.upgradeProbe(zcfProbeBundle); + await zoeDriver.upgradeProbe(zcfProbeBundle); const nextDucats = beforeResult.leftoverPayments.Ducats; const nextAmount = await EV(issuer).getAmountOf(nextDucats); diff --git a/packages/boot/test/upgrading/test-upgrade-contracts.js b/packages/boot/test/upgrading/test-upgrade-contracts.js index 5b056b7042e..fdb5edba1d2 100644 --- a/packages/boot/test/upgrading/test-upgrade-contracts.js +++ b/packages/boot/test/upgrading/test-upgrade-contracts.js @@ -7,32 +7,15 @@ import { test as anyTest } from '@agoric/swingset-vat/tools/prepare-test-env-ava import { buildVatController } from '@agoric/swingset-vat'; /** - * @type {import('ava').TestFn< - * Awaited> - * >} + * @type {import('ava').TestFn<{}>} */ const test = anyTest; -/** - * WARNING: uses ambient authority of import.meta.url - * - * We aim to use ambient authority only in test.before(); splitting out - * makeTestContext() lets us type t.context. - */ -const makeTestContext = async () => { - const bfile = name => new URL(name, import.meta.url).pathname; - const importSpec = spec => - importMetaResolve(spec, import.meta.url).then(u => new URL(u).pathname); - return { bfile, importSpec }; -}; - -test.before(async t => { - t.context = await makeTestContext(); -}); +const bfile = name => new URL(name, import.meta.url).pathname; +const importSpec = spec => + importMetaResolve(spec, import.meta.url).then(u => new URL(u).pathname); test('upgrade mintHolder', async t => { - const { bfile, importSpec } = t.context; - /** @type {SwingSetConfig} */ const config = harden({ bootstrap: 'bootstrap', diff --git a/packages/boot/test/upgrading/test-upgrade-vats.js b/packages/boot/test/upgrading/test-upgrade-vats.js index 40c2c91c892..bbbdf15c9c4 100644 --- a/packages/boot/test/upgrading/test-upgrade-vats.js +++ b/packages/boot/test/upgrading/test-upgrade-vats.js @@ -7,33 +7,21 @@ import { buildVatController } from '@agoric/swingset-vat'; import { makeRunUtils } from '../bootstrapTests/supports.js'; /** - * @type {import('ava').TestFn< - * Awaited> - * >} + * @type {import('ava').TestFn<{}>} */ const test = anyTest; const { Fail } = assert; +const bfile = name => new URL(name, import.meta.url).pathname; const importSpec = spec => importMetaResolve(spec, import.meta.url).then(u => new URL(u).pathname); -const makeTestContext = async metaUrl => { - const bfile = name => new URL(name, metaUrl).pathname; - - return { bfile }; -}; - const makeCallOutbound = t => (srcID, obj) => { t.log(`callOutbound(${srcID}, ${obj})`); return obj; }; -/** NOTE: limit ambient authority such as import.meta.url to test.before() */ -test.before(async t => { - t.context = await makeTestContext(import.meta.url); -}); - /** * @param {any} t * @param {Partial} [kernelConfigOverrides] @@ -133,7 +121,6 @@ test.failing('upgrade bootstrap vat', async t => { }); test('upgrade vat-bridge', async t => { - const { bfile } = t.context; const bundles = { bridge: { sourceSpec: await importSpec('@agoric/vats/src/vat-bridge.js') }, }; @@ -244,7 +231,6 @@ test('upgrade vat-bridge', async t => { }); test('upgrade vat-bank', async t => { - const { bfile } = t.context; const bundles = { bank: { sourceSpec: await importSpec('@agoric/vats/src/vat-bank.js') }, bridge: { sourceSpec: await importSpec('@agoric/vats/src/vat-bridge.js') }, diff --git a/packages/boot/tsconfig.json b/packages/boot/tsconfig.json index d293cd5e449..f3e0f6a0f37 100644 --- a/packages/boot/tsconfig.json +++ b/packages/boot/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "allowSyntheticDefaultImports": true, - "checkJs": false, + "checkJs": true, "maxNodeModuleJsDepth": 2, }, "include": [