Skip to content
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

chore(deps): upgrade Ava to 4.2 #5201

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions golang/cosmos/package.json
Expand Up @@ -2,6 +2,9 @@
"name": "@agoric/cosmos",
"version": "0.29.0",
"description": "Connect JS to the Cosmos blockchain SDK",
"parsers": {
"js": "mjs"
},
"main": "src/index.cjs",
"engines": {
"node": ">=14.15.0"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -14,7 +14,7 @@
"@jessie.js/eslint-plugin": "^0.1.3",
"@types/node": "^16.7.10",
"@typescript-eslint/parser": "^5.15.0",
"ava": "^3.15.0",
"ava": "^4.2.0",
"c8": "^7.11.0",
"conventional-changelog-conventionalcommits": "^4.6.0",
"eslint": "^7.32.0",
Expand Down Expand Up @@ -62,7 +62,7 @@
"timeout": "30m"
},
"dependencies": {
"patch-package": "^6.2.2"
"patch-package": "^6.4.7"
},
"resolutions": {
"**/react-scripts/@babel/core": "^7.12.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/ERTP/package.json
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@endo/bundle-source": "^2.2.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"fast-check": "^2.21.0"
},
"files": [
Expand Down
74 changes: 18 additions & 56 deletions packages/ERTP/test/unitTests/test-amountProperties.js
Expand Up @@ -4,7 +4,6 @@ import fc from 'fast-check';

import { AmountMath as m, AssetKind } from '../../src/index.js';
import { mockBrand } from './mathHelpers/mockBrand.js';
import { assertionPassed } from '../../../store/test/test-store.js';

// Perhaps makeCopyBag should coalesce duplicate labels, but for now, it does
// not.
Expand Down Expand Up @@ -36,23 +35,13 @@ test('isEqual is a (total) equivalence relation', async t => {
({ x, y, z }) => {
return (
// Total
assertionPassed(t.true([true, false].includes(m.isEqual(x, y))), () =>
[true, false].includes(m.isEqual(x, y)),
) &&
t.true([true, false].includes(m.isEqual(x, y))) &&
// Reflexive
assertionPassed(t.true(m.isEqual(x, x)), () => m.isEqual(x, x)) &&
t.true(m.isEqual(x, x)) &&
// Symmetric
assertionPassed(
t.true(implies(m.isEqual(x, y), m.isEqual(y, x))),
() => implies(m.isEqual(x, y), m.isEqual(y, x)),
) &&
t.true(implies(m.isEqual(x, y), m.isEqual(y, x))) &&
// Transitive
assertionPassed(
t.true(
implies(m.isEqual(x, y) && m.isEqual(y, z), m.isEqual(x, z)),
),
() => implies(m.isEqual(x, y) && m.isEqual(y, z), m.isEqual(x, z)),
)
t.true(implies(m.isEqual(x, y) && m.isEqual(y, z), m.isEqual(x, z)))
);
},
),
Expand All @@ -64,18 +53,13 @@ test('isGTE is a partial order with empty as minimum', async t => {
await fc.assert(
fc.property(fc.record({ x: arbAmount, y: arbAmount }), ({ x, y }) => {
return (
assertionPassed(t.true(m.isGTE(x, empty)), () => m.isGTE(x, empty)) &&
t.true(m.isGTE(x, empty)) &&
// Total
assertionPassed(t.true([true, false].includes(m.isGTE(x, y))), () =>
[true, false].includes(m.isGTE(x, y)),
) &&
t.true([true, false].includes(m.isGTE(x, y))) &&
// Reflexive
assertionPassed(t.true(m.isGTE(x, x)), () => m.isGTE(x, x)) &&
t.true(m.isGTE(x, x)) &&
// Antisymmetric
assertionPassed(
t.true(implies(m.isGTE(x, y) && m.isGTE(y, x), m.isEqual(x, y))),
() => implies(m.isGTE(x, y) && m.isGTE(y, x), m.isEqual(x, y)),
)
t.true(implies(m.isGTE(x, y) && m.isGTE(y, x), m.isEqual(x, y)))
);
}),
);
Expand All @@ -89,34 +73,20 @@ test('add: closed, commutative, associative, monotonic, with empty identity', as
({ x, y, z }) => {
return (
// note: + for SET is not total.
assertionPassed(t.truthy(m.coerce(mockBrand, m.add(x, y))), () =>
m.coerce(mockBrand, m.add(x, y)),
) &&
t.truthy(m.coerce(mockBrand, m.add(x, y))) &&
// Identity (right)
assertionPassed(t.true(m.isEqual(m.add(x, empty), x)), () =>
m.isEqual(m.add(x, empty), x),
) &&
t.true(m.isEqual(m.add(x, empty), x)) &&
// Identity (left)
assertionPassed(t.true(m.isEqual(m.add(empty, x), x)), () =>
m.isEqual(m.add(empty, x), x),
) &&
t.true(m.isEqual(m.add(empty, x), x)) &&
// Commutative
assertionPassed(t.true(m.isEqual(m.add(x, y), m.add(y, x))), () =>
m.isEqual(m.add(x, y), m.add(y, x)),
) &&
t.true(m.isEqual(m.add(x, y), m.add(y, x))) &&
// Associative
assertionPassed(
t.true(m.isEqual(m.add(m.add(x, y), z), m.add(x, m.add(y, z)))),
() => m.isEqual(m.add(m.add(x, y), z), m.add(x, m.add(y, z))),
) &&

t.true(m.isEqual(m.add(m.add(x, y), z), m.add(x, m.add(y, z)))) &&
// Monotonic (left)
assertionPassed(t.true(m.isGTE(m.add(x, y), x)), () =>
m.isGTE(m.add(x, y), x),
) &&
t.true(m.isGTE(m.add(x, y), x)) &&
// Monotonic (right)
assertionPassed(t.true(m.isGTE(m.add(x, y), y)), () =>
m.isGTE(m.add(x, y), y),
)
t.true(m.isGTE(m.add(x, y), y))
);
},
),
Expand All @@ -127,16 +97,8 @@ test('subtract: (x + y) - y = x; (y - x) + x = y if y >= x', async t => {
await fc.assert(
fc.property(fc.record({ x: arbAmount, y: arbAmount }), ({ x, y }) => {
return (
assertionPassed(t.true(m.isEqual(m.subtract(m.add(x, y), y), x)), () =>
m.isEqual(m.subtract(m.add(x, y), y), x),
) &&
assertionPassed(
t.true(
m.isGTE(y, x) ? m.isEqual(m.add(m.subtract(y, x), x), y) : true,
),
() =>
m.isGTE(y, x) ? m.isEqual(m.add(m.subtract(y, x), x), y) : true,
)
t.true(m.isEqual(m.subtract(m.add(x, y), y), x)) &&
t.true(m.isGTE(y, x) ? m.isEqual(m.add(m.subtract(y, x), x), y) : true)
);
}),
);
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/package.json
Expand Up @@ -24,7 +24,7 @@
"@agoric/vat-data": "^0.2.0",
"@endo/ses-ava": "^0.2.25",
"@types/tmp": "^0.2.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"tmp": "^0.2.1"
},
"dependencies": {
Expand Down Expand Up @@ -78,7 +78,8 @@
"files": [
"test/**/test-*.js"
],
"timeout": "20m"
"timeout": "20m",
"workerThreads": false
},
"publishConfig": {
"access": "public"
Expand Down
Binary file modified packages/SwingSet/test/snapshots/test-state.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/access-token/package.json
Expand Up @@ -20,7 +20,7 @@
"n-readlines": "^1.0.0"
},
"devDependencies": {
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/agoric-cli/.ava-integration-test.config.js
@@ -1,4 +1,5 @@
export default {
files: ['integration-tests/test-workflow.js'],
timeout: '10m',
workerThreads: false,
};
5 changes: 3 additions & 2 deletions packages/agoric-cli/package.json
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@agoric/swingset-vat": "^0.26.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.11.0",
"tmp": "^0.2.1"
},
Expand Down Expand Up @@ -65,6 +65,7 @@
"files": [
"test/**/test-*.js"
],
"timeout": "2m"
"timeout": "2m",
"workerThreads": false
}
}
8 changes: 0 additions & 8 deletions packages/assert/package.json
Expand Up @@ -31,19 +31,11 @@
"url": "https://github.com/Agoric/agoric-sdk/issues"
},
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"devDependencies": {
"ava": "^3.12.1"
},
"files": [
"src/",
"exported.js",
"NEWS.md"
],
"ava": {
"files": [
"test/**/test-*.js"
]
},
"eslintConfig": {
"extends": [
"@agoric"
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/package.json
Expand Up @@ -45,7 +45,7 @@
"tmp": "^0.2.1"
},
"devDependencies": {
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-script-support/package.json
Expand Up @@ -51,7 +51,7 @@
},
"devDependencies": {
"@agoric/swingset-vat": "^0.26.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"import-meta-resolve": "^1.1.1"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/governance/package.json
Expand Up @@ -46,7 +46,7 @@
"@agoric/swingset-vat": "^0.26.0",
"@endo/bundle-source": "^2.2.0",
"@endo/init": "^0.5.41",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.11.0",
"import-meta-resolve": "^1.1.1",
"ses": "^0.15.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/import-manager/package.json
Expand Up @@ -30,7 +30,7 @@
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"devDependencies": {
"@agoric/swingset-vat": "^0.26.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/notifier/package.json
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@endo/init": "^0.5.41",
"@endo/ses-ava": "^0.2.25",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/pegasus/package.json
Expand Up @@ -45,7 +45,7 @@
},
"devDependencies": {
"@agoric/deploy-script-support": "^0.7.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.11.0",
"import-meta-resolve": "^1.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/run-protocol/package.json
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@agoric/deploy-script-support": "^0.7.0",
"@endo/init": "^0.5.41",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.11.0",
"fast-check": "^2.21.0",
"import-meta-resolve": "^1.1.1"
Expand Down
3 changes: 1 addition & 2 deletions packages/run-protocol/test/psm/test-psm.js
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
@@ -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
@@ -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
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
9 changes: 0 additions & 9 deletions packages/same-structure/package.json
Expand Up @@ -33,9 +33,6 @@
"@agoric/store": "^0.7.0",
"@endo/marshal": "^0.6.7"
},
"devDependencies": {
"ava": "^3.12.1"
},
"files": [
"*.js",
"NEWS.md"
Expand All @@ -50,11 +47,5 @@
],
"publishConfig": {
"access": "public"
},
"ava": {
"files": [
"test/**/test-*.js"
],
"timeout": "2m"
}
}
2 changes: 1 addition & 1 deletion packages/sharing-service/package.json
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@agoric/swingset-vat": "^0.26.0",
"@endo/eventual-send": "^0.15.3",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/solo/package.json
Expand Up @@ -57,7 +57,7 @@
"devDependencies": {
"@agoric/ertp": "^0.14.0",
"@endo/bundle-source": "^2.2.0",
"ava": "^3.12.1",
"ava": "^4.2.0",
"c8": "^7.7.2"
},
"eslintConfig": {
Expand Down