diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js index a40f801ea1e..69be9687ed3 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js @@ -19,13 +19,13 @@ test('natMathHelpers make', t => { t.throws( () => m.make('abc', mockBrand), { - message: 'value (a string) must be a Nat or an array', + message: /value .* must be a Nat or an array/, }, `'abc' is not a nat`, ); t.throws( () => m.make(-1, mockBrand), - { message: 'value (a number) must be a Nat or an array' }, + { message: /value .* must be a Nat or an array/ }, `- 1 is not a valid Nat`, ); }); @@ -34,7 +34,7 @@ test('natMathHelpers make no brand', t => { t.throws( () => m.make(4n), { - message: "The brand (an undefined) doesn't look like a brand.", + message: /The brand "\[undefined\]" doesn't look like a brand./, }, `brand is required in make`, ); @@ -70,7 +70,7 @@ test('natMathHelpers coerce', t => { t.throws( () => m.coerce(3n, mockBrand), { - message: `The amount (a bigint) doesn't look like an amount. Did you pass a value instead?`, + message: /The amount .* doesn't look like an amount. Did you pass a value instead?/, }, `coerce needs a brand`, ); @@ -81,7 +81,7 @@ test('natMathHelpers coerce no brand', t => { // @ts-ignore deliberate invalid arguments for testing () => m.coerce(m.make(4n, mockBrand)), { - message: "The brand (an undefined) doesn't look like a brand.", + message: /The brand "\[undefined\]" doesn't look like a brand./, }, `brand is required in coerce`, ); @@ -97,7 +97,7 @@ test('natMathHelpers getValue no brand', t => { // @ts-ignore deliberate invalid arguments for testing () => m.getValue(m.make(4n, mockBrand)), { - message: "The brand (an undefined) doesn't look like a brand.", + message: /The brand "\[undefined\]" doesn't look like a brand./, }, `brand is required in getValue`, ); @@ -114,7 +114,7 @@ test('natMathHelpers makeEmpty no brand', t => { // @ts-ignore deliberate invalid arguments for testing () => m.makeEmpty(MathKind.NAT), { - message: "The brand (a string) doesn't look like a brand.", + message: /The brand .* doesn't look like a brand./, }, `make empty no brand`, ); @@ -128,21 +128,21 @@ test('natMathHelpers isEmpty', t => { t.throws( () => m.isEmpty('abc'), { - message: `The amount (a string) doesn't look like an amount. Did you pass a value instead?`, + message: /The amount .* doesn't look like an amount. Did you pass a value instead?/, }, `isEmpty('abc') throws because it cannot be coerced`, ); t.throws( () => m.isEmpty({ brand: mockBrand, value: 'abc' }), { - message: 'value (a string) must be a Nat or an array', + message: /value .* must be a Nat or an array/, }, `isEmpty('abc') throws because it cannot be coerced`, ); t.throws( () => m.isEmpty(0n), { - message: `The amount (a bigint) doesn't look like an amount. Did you pass a value instead?`, + message: /The amount .* doesn't look like an amount. Did you pass a value instead?/, }, `isEmpty(0) throws because it cannot be coerced`, ); @@ -161,8 +161,7 @@ test('natMathHelpers isGTE mixed brands', t => { t.throws( () => m.isGTE(m.make(5n, Far('otherBrand', {})), m.make(3n, mockBrand)), { - message: - 'Brands in left (an object) and right (an object) should match but do not', + message: /Brands in left .* and right .* should match but do not/, }, ); }); @@ -176,8 +175,7 @@ test(`natMathHelpers isGTE - brands don't match objective brand`, t => { Far('otherBrand', {}), ), { - message: - "amount's brand (an object) did not match expected brand (an object)", + message: /amount's brand .* did not match expected brand .*/, }, ); }); @@ -197,8 +195,7 @@ test('natMathHelpers isEqual mixed brands', t => { t.throws( () => m.isEqual(m.make(4n, Far('otherBrand', {})), m.make(4n, mockBrand)), { - message: - 'Brands in left (an object) and right (an object) should match but do not', + message: /Brands in left .* and right .* should match but do not/, }, ); }); @@ -212,8 +209,7 @@ test(`natMathHelpers isEqual - brands don't match objective brand`, t => { Far('otherBrand', {}), ), { - message: - "amount's brand (an object) did not match expected brand (an object)", + message: /amount's brand .* did not match expected brand .*/, }, ); }); @@ -230,8 +226,7 @@ test('natMathHelpers add mixed brands', t => { t.throws( () => m.add(m.make(5n, Far('otherBrand', {})), m.make(9n, mockBrand)), { - message: - 'Brands in left (an object) and right (an object) should match but do not', + message: /Brands in left .* and right .* should match but do not/, }, ); }); @@ -245,8 +240,7 @@ test(`natMathHelpers add - brands don't match objective brand`, t => { Far('otherBrand', {}), ), { - message: - "amount's brand (an object) did not match expected brand (an object)", + message: /amount's brand .* did not match expected brand .*/, }, ); }); @@ -263,8 +257,7 @@ test('natMathHelpers subtract mixed brands', t => { t.throws( () => m.subtract(m.make(6n, Far('otherBrand', {})), m.make(1n, mockBrand)), { - message: - 'Brands in left (an object) and right (an object) should match but do not', + message: /Brands in left .* and right .* should match but do not/, }, ); }); @@ -278,8 +271,7 @@ test(`natMathHelpers subtract brands don't match brand`, t => { Far('otherBrand', {}), ), { - message: - "amount's brand (an object) did not match expected brand (an object)", + message: /amount's brand .* did not match expected brand .*/, }, ); }); diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js index d0927bc0f61..188fc41a014 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js @@ -48,7 +48,7 @@ const runSetMathHelpersTests = (t, [a, b, c], a2 = undefined) => { ); t.throws( () => m.make('a', mockBrand), - { message: `value (a string) must be a Nat or an array` }, + { message: /value .* must be a Nat or an array/ }, 'strings are not valid', ); if (a2 !== undefined) { @@ -87,7 +87,7 @@ const runSetMathHelpersTests = (t, [a, b, c], a2 = undefined) => { ); t.throws( () => m.coerce({ brand: mockBrand, value: 'a' }, mockBrand), - { message: `value (a string) must be a Nat or an array` }, + { message: /value .* must be a Nat or an array/ }, 'strings are not valid', ); if (a2 !== undefined) { @@ -119,7 +119,7 @@ const runSetMathHelpersTests = (t, [a, b, c], a2 = undefined) => { ); t.throws( () => m.isEmpty({ brand: mockBrand, value: harden({}) }), - { message: `value (an object) must be a Nat or an array` }, + { message: /value .* must be a Nat or an array/ }, `m.isEmpty({}) throws`, ); t.falsy(m.isEmpty(m.make(['abc'], mockBrand)), `m.isEmpty(['abc']) is false`); diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js index bc8e561acf7..a8465ab386f 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js @@ -20,7 +20,7 @@ test('set with strings make', t => { ); t.throws( () => m.make('abc', mockBrand), - { message: `value (a string) must be a Nat or an array` }, + { message: /value .* must be a Nat or an array/ }, `'abc' is not a valid string array`, ); t.throws( @@ -42,7 +42,7 @@ test('set with strings coerce', t => { ); t.throws( () => m.coerce({ brand: mockBrand, value: '6' }, mockBrand), - { message: `value (a string) must be a Nat or an array` }, + { message: /value .* must be a Nat or an array/ }, `'6' is not a valid array`, ); t.throws( @@ -71,7 +71,7 @@ test('set with strings makeEmpty', t => { ); t.throws( () => m.isEmpty({ brand: mockBrand, value: ['a', 'a'] }), - { message: `value has duplicates: (a string) and (a string)` }, + { message: /value has duplicates: .* and .*/ }, `duplicates in isEmpty throw`, ); }); @@ -185,7 +185,7 @@ test('set with strings add', t => { { brand: mockBrand, value: ['a'] }, { brand: mockBrand, value: ['a'] }, ), - { message: `value has duplicates: (a string) and (a string)` }, + { message: /value has duplicates: .* and .*/ }, `overlap between left and right of add should throw`, ); t.deepEqual( @@ -231,7 +231,7 @@ test('set with strings subtract', t => { { brand: mockBrand, value: ['a', 'b'] }, { brand: mockBrand, value: ['c'] }, ), - { message: `right element (a string) was not in left` }, + { message: /right element .* was not in left/ }, `elements in right but not in left of subtract should throw`, ); t.deepEqual( diff --git a/packages/ERTP/test/unitTests/test-issuerObj.js b/packages/ERTP/test/unitTests/test-issuerObj.js index c781833ac60..35507d89026 100644 --- a/packages/ERTP/test/unitTests/test-issuerObj.js +++ b/packages/ERTP/test/unitTests/test-issuerObj.js @@ -45,7 +45,12 @@ test('bad display info', t => { // @ts-ignore deliberate invalid arguments for testing t.throws(() => makeIssuerKit('fungible', MathKind.NAT, displayInfo), { message: - 'key "somethingUnexpected" was not one of the expected keys ["decimalPlaces"]', + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /key "somethingUnexpected" was not one of the expected keys \["decimalPlaces"\]/, + /key .* was not one of the expected keys .*/, }); }); @@ -415,7 +420,15 @@ test('issuer.combine bad payments', async t => { await t.throwsAsync( () => E(issuer).combine(payments), - { message: /"payment" not found/ }, + { + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"payment" not found/ + /.* not found/, + }, 'payment from other mint is not found', ); }); diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index 5c2bb0c9e05..764578d23bf 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -59,7 +59,7 @@ "rollup": "^1.23.1", "rollup-plugin-node-resolve": "^5.2.0", "semver": "^6.3.0", - "ses": "^0.12.3", + "ses": "^0.12.5", "yargs": "^14.2.0" }, "files": [ diff --git a/packages/assert/package.json b/packages/assert/package.json index cf3cb190c39..e0b31fbbd9f 100755 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -68,6 +68,6 @@ "access": "public" }, "dependencies": { - "ses": "^0.12.3" + "ses": "^0.12.5" } } diff --git a/packages/dapp-svelte-wallet/api/test/test-lib-dehydrate.js b/packages/dapp-svelte-wallet/api/test/test-lib-dehydrate.js index 2eda1559f81..0e6c8632249 100644 --- a/packages/dapp-svelte-wallet/api/test/test-lib-dehydrate.js +++ b/packages/dapp-svelte-wallet/api/test/test-lib-dehydrate.js @@ -18,7 +18,7 @@ test('makeDehydrator', async t => { instanceHandleMapping.addPetname('atomicSwap', handle2); instanceHandleMapping.addPetname('automaticRefund', handle3); t.throws(() => instanceHandleMapping.addPetname('simpleExchange2', handle1), { - message: /val \(an object\) already has a petname/, + message: /val .* already has a petname/, }); t.throws( () => @@ -26,7 +26,7 @@ test('makeDehydrator', async t => { 'simpleExchange', Far('simpleExchangeHandle'), ), - { message: /petname \(a string\) is already in use/ }, + { message: /petname .* is already in use/ }, ); // Test renaming. @@ -77,7 +77,15 @@ test('makeDehydrator', async t => { instanceHandleMapping.deletePetname('to be deleted'); t.throws( () => instanceHandleMapping.petnameToVal.get('to be deleted'), - { message: /"petname" not found/ }, + { + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"petname" not found/ + /.* not found/, + }, `can't get what has been deleted`, ); diff --git a/packages/dapp-svelte-wallet/api/test/test-lib-wallet.js b/packages/dapp-svelte-wallet/api/test/test-lib-wallet.js index 561980f10bd..0cc8e79ec6a 100644 --- a/packages/dapp-svelte-wallet/api/test/test-lib-wallet.js +++ b/packages/dapp-svelte-wallet/api/test/test-lib-wallet.js @@ -472,7 +472,15 @@ test('lib-wallet dapp suggests issuer, instance, installation petnames', async t t.throws( () => wallet.getInstallation('whatever'), - { message: /"petname" not found/ }, + { + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"petname" not found/ + /.* not found/, + }, `using a petname that doesn't exist errors`, ); diff --git a/packages/dapp-svelte-wallet/ui/package.json b/packages/dapp-svelte-wallet/ui/package.json index 8f43f24c118..f36c2e21191 100644 --- a/packages/dapp-svelte-wallet/ui/package.json +++ b/packages/dapp-svelte-wallet/ui/package.json @@ -24,7 +24,7 @@ "rollup-plugin-livereload": "^1.0.0", "rollup-plugin-svelte": "^5.0.3", "rollup-plugin-terser": "^6.1.0", - "ses": "^0.12.3", + "ses": "^0.12.5", "sirv-cli": "^1.0.0", "smelte": "^1.0.15", "svelte": "^3.0.0", diff --git a/packages/deploy-script-support/test/unitTests/test-assertOfferResult.js b/packages/deploy-script-support/test/unitTests/test-assertOfferResult.js index 80ed2025601..fba33d3f4bd 100644 --- a/packages/deploy-script-support/test/unitTests/test-assertOfferResult.js +++ b/packages/deploy-script-support/test/unitTests/test-assertOfferResult.js @@ -12,6 +12,6 @@ test('assertOfferResult', async t => { }; await t.notThrowsAsync(() => assertOfferResult(mockSeat, 'result')); await t.throwsAsync(() => assertOfferResult(mockSeat, 'not result'), { - message: 'offerResult ((a string)) did not equal expected: (a string)', + message: /offerResult (.*) did not equal expected: .*/, }); }); diff --git a/packages/install-ses/package.json b/packages/install-ses/package.json index f5307e4ff6e..982b8488a2e 100644 --- a/packages/install-ses/package.json +++ b/packages/install-ses/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@agoric/eventual-send": "^0.13.4", - "ses": "^0.12.3" + "ses": "^0.12.5" }, "files": [ "src/**/*.js" diff --git a/packages/spawner/test/swingsetTests/escrow/test-escrow.js b/packages/spawner/test/swingsetTests/escrow/test-escrow.js index 0b09c28159c..6dd28c4dc30 100644 --- a/packages/spawner/test/swingsetTests/escrow/test-escrow.js +++ b/packages/spawner/test/swingsetTests/escrow/test-escrow.js @@ -21,7 +21,7 @@ test.skip('escrow checkUnits w/SES', async t => { const escrowMismatchGolden = [ 'starting testEscrowServiceCheckMismatches', - 'expected unsuccessful check Error: Escrow checkUnits: different at top.right.value: ((a string)) vs ((a string))', + /expected unsuccessful check Error: Escrow checkUnits: different at top.right.value: (.*) vs (.*)/, ]; test.skip('escrow check misMatches w/SES', async t => { @@ -31,7 +31,7 @@ test.skip('escrow check misMatches w/SES', async t => { const escrowCheckPartialWrongPriceGolden = [ 'starting testEscrowServiceCheckPartial wrong price', - 'expected wrong price Error: Escrow checkPartialUnits seat: different at top.value: ((a number)) vs ((a number))', + /expected wrong price Error: Escrow checkPartialUnits seat: different at top.value: (.*) vs (.*)/, ]; test.skip('escrow check partial price misMatches w/SES', async t => { @@ -41,7 +41,7 @@ test.skip('escrow check partial price misMatches w/SES', async t => { const escrowCheckPartialWrongStockGolden = [ 'starting testEscrowServiceCheckPartial wrong stock', - 'expected wrong stock Error: Escrow checkPartialUnits seat: different at top.value: ((a string)) vs ((a string))', + /expected wrong stock Error: Escrow checkPartialUnits seat: different at top.value: (.*) vs (.*)/, ]; test.skip('escrow check partial stock misMatches w/SES', async t => { @@ -51,7 +51,7 @@ test.skip('escrow check partial stock misMatches w/SES', async t => { const escrowCheckPartialWrongSeatGolden = [ 'starting testEscrowServiceCheckPartial wrong seat', - 'expected wrong side Error: Escrow checkPartialUnits seat: label not found on right at top: ((an object)) vs ((an object))', + /expected wrong side Error: Escrow checkPartialUnits seat: label not found on right at top: (.*) vs (.*)/, ]; test.skip('escrow check partial wrong seat w/SES', async t => { diff --git a/packages/store/test/test-store.js b/packages/store/test/test-store.js index 440ac506165..791b08c8331 100644 --- a/packages/store/test/test-store.js +++ b/packages/store/test/test-store.js @@ -44,7 +44,13 @@ function check(t, mode, objMaker) { checkEntries([[k1, 'one']]); t.throws(() => s.init(k1, 'other'), { - message: /"store1" already registered:/, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"store1" already registered:/, + /.* already registered:/, }); t.throws(() => s.get(k2), { message: /"store1" not found:/ }); t.throws(() => s.set(k2, 'other'), { message: /"store1" not found:/ }); diff --git a/packages/ui-components/test/display/natValue/test-captureNum.js b/packages/ui-components/test/display/natValue/test-captureNum.js index 5eb45ff4a96..448b0cf8694 100644 --- a/packages/ui-components/test/display/natValue/test-captureNum.js +++ b/packages/ui-components/test/display/natValue/test-captureNum.js @@ -13,24 +13,24 @@ test('captureNum', t => { test('captureNum neg num throws', t => { t.throws(() => captureNum('-200'), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); t.throws(() => captureNum('-200.00'), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); t.throws(() => captureNum('-0200.00'), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); t.throws(() => captureNum('-200.020'), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); }); test('captureNum non-number throws', t => { t.throws(() => captureNum('a'), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); t.throws(() => captureNum({}), { - message: '(an object) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); }); diff --git a/packages/ui-components/test/display/natValue/test-parseAsNat.js b/packages/ui-components/test/display/natValue/test-parseAsNat.js index 0172df9164e..6bb6677ca1c 100644 --- a/packages/ui-components/test/display/natValue/test-parseAsNat.js +++ b/packages/ui-components/test/display/natValue/test-parseAsNat.js @@ -45,6 +45,6 @@ test('parseAsNat ether to wei', t => { test('parseAsNat negative throws', t => { t.throws(() => parseAsNat('-200.00', 2), { - message: '(a string) must be a non-negative decimal number', + message: /.* must be a non-negative decimal number/, }); }); diff --git a/packages/ui-components/test/display/natValue/test-roundToDecimalPlaces.js b/packages/ui-components/test/display/natValue/test-roundToDecimalPlaces.js index 9ffa1e1a969..9002ada403a 100644 --- a/packages/ui-components/test/display/natValue/test-roundToDecimalPlaces.js +++ b/packages/ui-components/test/display/natValue/test-roundToDecimalPlaces.js @@ -18,14 +18,14 @@ test('roundToDecimalPlaces', t => { test('roundToDecimalPlaces non-string throws', t => { // @ts-ignore deliberate error for testing t.throws(() => round({}, 0), { - message: '(an object) must be a string', + message: /.* must be a string/, }); }); test('roundToDecimalPlaces non-num decimalPlaces throws', t => { // @ts-ignore deliberate error for testing t.throws(() => round('020', '0'), { - message: '(a string) must be a number', + message: /.* must be a number/, }); }); diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index 71591dd5814..b44173617d5 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -33,7 +33,7 @@ "@agoric/install-ses": "^0.5.4", "esm": "^3.2.5", "glob": "^7.1.6", - "ses": "^0.12.3" + "ses": "^0.12.5" }, "devDependencies": { "@rollup/plugin-node-resolve": "^6.1.0", diff --git a/packages/zoe/package.json b/packages/zoe/package.json index f71d78e77b4..78ab4990553 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -62,7 +62,7 @@ "ava": "^3.12.1", "esm": "^3.2.25", "nyc": "^15.1.0", - "ses": "^0.12.3" + "ses": "^0.12.5" }, "files": [ "bundles/", diff --git a/packages/zoe/test/unitTests/contractSupport/test-bondingCurves.js b/packages/zoe/test/unitTests/contractSupport/test-bondingCurves.js index 3f90595d8f0..74e55e8f2ed 100644 --- a/packages/zoe/test/unitTests/contractSupport/test-bondingCurves.js +++ b/packages/zoe/test/unitTests/contractSupport/test-bondingCurves.js @@ -57,7 +57,7 @@ test('getInputPrice no reserves', t => { outputReserve: 0n, inputValue: 1n, }; - const message = 'inputReserve (a bigint) must be positive'; + const message = /inputReserve .* must be positive/; getInputPricethrows(t, input, message); }); @@ -127,7 +127,7 @@ test('getInputPrice bad reserve 1', t => { inputReserve: 43n, inputValue: 347n, }; - const message = 'outputReserve (a bigint) must be positive'; + const message = /outputReserve .* must be positive/; getInputPricethrows(t, input, message); }); @@ -137,7 +137,7 @@ test('getInputPrice bad reserve 2', t => { inputReserve: 0n, inputValue: 828n, }; - const message = 'inputReserve (a bigint) must be positive'; + const message = /inputReserve .* must be positive/; getInputPricethrows(t, input, message); }); @@ -147,7 +147,7 @@ test('getInputPrice zero input', t => { inputReserve: 320n, inputValue: 0n, }; - const message = 'inputValue (a bigint) must be positive'; + const message = /inputValue .* must be positive/; getInputPricethrows(t, input, message); }); @@ -192,7 +192,7 @@ test('getOutputPrice zero output reserve', t => { inputReserve: 43n, outputValue: 37n, }; - const message = 'outputReserve (a bigint) must be positive'; + const message = /outputReserve .* must be positive/; getOutputPricethrows(t, input, message); }); @@ -202,7 +202,7 @@ test('getOutputPrice zero input reserve', t => { inputReserve: 0n, outputValue: 37n, }; - const message = 'inputReserve (a bigint) must be positive'; + const message = /inputReserve .* must be positive/; getOutputPricethrows(t, input, message); }); @@ -212,8 +212,7 @@ test('getOutputPrice too much output', t => { inputReserve: 1132n, outputValue: 20923n, }; - const message = - 'outputReserve (a bigint) must be greater than outputValue (a bigint)'; + const message = /outputReserve .* must be greater than outputValue .*/; getOutputPricethrows(t, input, message); }); @@ -223,8 +222,7 @@ test('getOutputPrice too much output 2', t => { inputReserve: 1132n, outputValue: 345n, }; - const message = - 'outputReserve (a bigint) must be greater than outputValue (a bigint)'; + const message = /outputReserve .* must be greater than outputValue .*/; getOutputPricethrows(t, input, message); }); diff --git a/packages/zoe/test/unitTests/contractSupport/test-depositTo.js b/packages/zoe/test/unitTests/contractSupport/test-depositTo.js index d0908dac285..6cc30956143 100644 --- a/packages/zoe/test/unitTests/contractSupport/test-depositTo.js +++ b/packages/zoe/test/unitTests/contractSupport/test-depositTo.js @@ -94,7 +94,7 @@ test(`depositToSeat - mismatched keywords`, async t => { await t.throwsAsync( () => depositToSeat(zcf, zcfSeat, { C: bucks(2) }, { D: newBucks }), { - message: `payment not found for (a string)`, + message: /payment not found for .*/, }, 'mismatched keywords', ); diff --git a/packages/zoe/test/unitTests/contractSupport/test-percentSupport.js b/packages/zoe/test/unitTests/contractSupport/test-percentSupport.js index e63ac36fc03..f015a13bf14 100644 --- a/packages/zoe/test/unitTests/contractSupport/test-percentSupport.js +++ b/packages/zoe/test/unitTests/contractSupport/test-percentSupport.js @@ -68,9 +68,15 @@ test('ratio - complement', t => { amountsEqual(t, multiplyBy(moe(100000), twoThirds), moe(66666), brand); t.throws(() => oneMinus(moe(3)), { - message: /Parameter must be a Ratio record, but \(an object\) has "brand"/, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /Parameter must be a Ratio record, but .* has "brand"/, + /Parameter must be a Ratio record, but .* has .*/, }); t.throws(() => oneMinus(makeRatioFromAmounts(moe(30), moe(20))), { - message: 'Parameter must be less than or equal to 1: (a bigint)/(a bigint)', + message: /Parameter must be less than or equal to 1: .*/, }); }); diff --git a/packages/zoe/test/unitTests/contractSupport/test-ratio.js b/packages/zoe/test/unitTests/contractSupport/test-ratio.js index 3f4e8f70d78..9a8c0470d94 100644 --- a/packages/zoe/test/unitTests/contractSupport/test-ratio.js +++ b/packages/zoe/test/unitTests/contractSupport/test-ratio.js @@ -198,10 +198,10 @@ test('ratio bad inputs', t => { message: 'undefined is a undefined but must be a bigint or a number', }); t.throws(() => multiplyBy(37, makeRatioFromAmounts(moe(3n), moe(5n))), { - message: 'Expected an amount: (a number)', + message: /Expected an amount: .*/, }); t.throws(() => divideBy(makeRatioFromAmounts(moe(3n), moe(5n)), 37), { - message: `Expected an amount: (an object)`, + message: /Expected an amount: .*/, }); t.throws(() => makeRatio(3n, brand, 0n), { message: /No infinite ratios! Denominator was 0/, diff --git a/packages/zoe/test/unitTests/contracts/loan/test-borrow.js b/packages/zoe/test/unitTests/contracts/loan/test-borrow.js index a2f7d4c5880..1a8515afe82 100644 --- a/packages/zoe/test/unitTests/contracts/loan/test-borrow.js +++ b/packages/zoe/test/unitTests/contracts/loan/test-borrow.js @@ -153,8 +153,7 @@ test('borrow not enough collateral', async t => { // collateral is 0 const { borrowSeat } = await setupBorrowFacet(0n); await t.throwsAsync(() => E(borrowSeat).getOfferResult(), { - message: - 'The required margin is (a bigint)% but collateral only had value of (a bigint)', + message: /The required margin is .*% but collateral only had value of .*/, }); }); @@ -360,8 +359,7 @@ test('getDebtNotifier with interest', async t => { const seat = await E(zoe).offer(closeLoanInvitation, proposal, payments); await t.throwsAsync(() => seat.getOfferResult(), { - message: - 'Not enough Loan assets have been repaid. (an object) is required, but only (an object) was repaid.', + message: /Not enough Loan assets have been repaid. {2}.* is required, but only .* was repaid./, }); }); @@ -373,8 +371,7 @@ test('borrow collateral just too low', async t => { const { borrowSeat: borrowSeatBad } = await setupBorrowFacet(74n); await t.throwsAsync(() => E(borrowSeatBad).getOfferResult(), { - message: - 'The required margin is (a bigint)% but collateral only had value of (a bigint)', + message: /The required margin is .*% but collateral only had value of .*/, }); }); diff --git a/packages/zoe/test/unitTests/contracts/test-escrowToVote.js b/packages/zoe/test/unitTests/contracts/test-escrowToVote.js index bf44f86b5e1..cef1c7f464e 100644 --- a/packages/zoe/test/unitTests/contracts/test-escrowToVote.js +++ b/packages/zoe/test/unitTests/contracts/test-escrowToVote.js @@ -100,7 +100,15 @@ test('zoe - escrowToVote', async t => { const voter = await E(seat).getOfferResult(); await t.throwsAsync( () => E(voter).vote('NOT A VALID ANSWER'), - { message: /the answer "NOT A VALID ANSWER" was not 'YES' or 'NO'/ }, + { + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /the answer "NOT A VALID ANSWER" was not 'YES' or 'NO'/ + /the answer .* was not 'YES' or 'NO'/, + }, `A vote with an invalid answer throws`, ); diff --git a/packages/zoe/test/unitTests/contracts/test-throwInOfferHandler.js b/packages/zoe/test/unitTests/contracts/test-throwInOfferHandler.js index 099320b81b5..44806c860c0 100644 --- a/packages/zoe/test/unitTests/contracts/test-throwInOfferHandler.js +++ b/packages/zoe/test/unitTests/contracts/test-throwInOfferHandler.js @@ -63,7 +63,7 @@ test('throw in offerHandler', async t => { // "Rejected promise returned by test. Reason: // Error { - // message: '"brand" not found: (an object)', + // message: /"brand" not found: .*/, // } // › makeDetailedError (/Users/katesills/code/agoric-sdk/node_modules/ses/dist/ses.cjs:3437:17) // › fail (/Users/katesills/code/agoric-sdk/node_modules/ses/dist/ses.cjs:3582:19) @@ -78,6 +78,12 @@ test('throw in offerHandler', async t => { // › src/zoeService/zoe.js:408:28" await t.throwsAsync(() => throwsInDepositToSeatResult, { - message: `"brand" not found: (an object)`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"brand" not found: .*/, + /.* not found: .*/, }); }); diff --git a/packages/zoe/test/unitTests/test-cleanProposal.js b/packages/zoe/test/unitTests/test-cleanProposal.js index ec31e40af65..8fc976b1960 100644 --- a/packages/zoe/test/unitTests/test-cleanProposal.js +++ b/packages/zoe/test/unitTests/test-cleanProposal.js @@ -91,7 +91,6 @@ test('cleanProposal - wrong mathKind', t => { const getMathKindByBrand = _brand => MathKind.SET; t.throws(() => cleanProposal(proposal, getMathKindByBrand), { - message: - 'The amount (an object) did not have the mathKind of the brand (a string)', + message: /The amount .* did not have the mathKind of the brand .*/, }); }); diff --git a/packages/zoe/test/unitTests/test-zoe.js b/packages/zoe/test/unitTests/test-zoe.js index 9186d1b12ab..7f5d0ff1eb0 100644 --- a/packages/zoe/test/unitTests/test-zoe.js +++ b/packages/zoe/test/unitTests/test-zoe.js @@ -51,7 +51,13 @@ test(`zoe.startInstance bad installation`, async t => { const { zoe } = setup(); // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(() => E(zoe).startInstance(), { - message: `(an undefined) was not a valid installation`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"\[undefined\]" was not a valid installation/, + /.* was not a valid installation/, }); }); @@ -120,7 +126,13 @@ test(`zoe.startInstance - terms, issuerKeywordRecord switched`, async t => { { Moola: moolaKit.issuer }, ), { - message: `keyword "something" must be ascii and must start with a capital letter.`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /keyword "something" must be ascii and must start with a capital letter./ + /keyword .* must be ascii and must start with a capital letter./, }, ); }); @@ -136,7 +148,7 @@ test(`zoe.offer - no invitation`, async t => { const { zoe } = await setupZCFTest(); // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(() => E(zoe).offer(), { - message: `A Zoe invitation is required, not (an undefined)`, + message: /A Zoe invitation is required, not "\[undefined\]"/, }); }); @@ -155,7 +167,13 @@ test(`zoe.getPublicFacet - no instance`, async t => { const { zoe } = setup(); // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(() => E(zoe).getPublicFacet(), { - message: `"instance" not found: (an undefined)`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"instance" not found: "\[undefined\]"/, + /.* not found: "\[undefined\]"/, }); }); @@ -183,7 +201,13 @@ test(`zoe.getIssuers - no instance`, async t => { const { zoe } = setup(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getIssuers(), { - message: `"instance" not found: (an undefined)`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"instance" not found: "\[undefined\]"/, + /.* not found: "\[undefined\]"/, }); }); @@ -211,7 +235,13 @@ test(`zoe.getBrands - no instance`, async t => { const { zoe } = setup(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getBrands(), { - message: `"instance" not found: (an undefined)`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"instance" not found: "\[undefined\]"/, + /.* not found: "\[undefined\]"/, }); }); @@ -268,7 +298,13 @@ test(`zoe.getTerms - no instance`, async t => { const { zoe } = setup(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getTerms(), { - message: `"instance" not found: (an undefined)`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"instance" not found: "\[undefined\]"/, + /.* not found: "\[undefined\]"/, }); }); @@ -283,7 +319,7 @@ test(`zoe.getInstance - no invitation`, async t => { const { zoe } = await setupZCFTest(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getInstance(), { - message: `A Zoe invitation is required, not (an undefined)`, + message: /A Zoe invitation is required, not "\[undefined\]"/, }); }); @@ -298,7 +334,7 @@ test(`zoe.getInstallation - no invitation`, async t => { const { zoe } = await setupZCFTest(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getInstallation(), { - message: `A Zoe invitation is required, not (an undefined)`, + message: /A Zoe invitation is required, not "\[undefined\]"/, }); }); @@ -318,6 +354,6 @@ test(`zoe.getInvitationDetails - no invitation`, async t => { const { zoe } = await setupZCFTest(); // @ts-ignore invalid arguments for testing await t.throwsAsync(() => E(zoe).getInvitationDetails(), { - message: `A Zoe invitation is required, not (an undefined)`, + message: /A Zoe invitation is required, not "\[undefined\]"/, }); }); diff --git a/packages/zoe/test/unitTests/zcf/test-zcf.js b/packages/zoe/test/unitTests/zcf/test-zcf.js index 37e567651a9..6b00b793bde 100644 --- a/packages/zoe/test/unitTests/zcf/test-zcf.js +++ b/packages/zoe/test/unitTests/zcf/test-zcf.js @@ -162,17 +162,41 @@ test(`zcf.assertUniqueKeyword`, async t => { const issuerKeywordRecord = { A: moolaKit.issuer, B: simoleanKit.issuer }; const { zcf } = await setupZCFTest(issuerKeywordRecord); t.throws(() => zcf.assertUniqueKeyword('A'), { - message: 'keyword "A" must be unique', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /keyword "A" must be unique/, + /keyword .* must be unique/, }); t.throws(() => zcf.assertUniqueKeyword('B'), { - message: 'keyword "B" must be unique', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /keyword "B" must be unique/, + /keyword .* must be unique/, }); // Unique, but not a valid Keyword t.throws(() => zcf.assertUniqueKeyword('a'), { - message: 'keyword "a" must be ascii and must start with a capital letter.', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // 'keyword "a" must be ascii and must start with a capital letter.', + /keyword .* must be ascii and must start with a capital letter./, }); t.throws(() => zcf.assertUniqueKeyword('3'), { - message: 'keyword "3" must be ascii and must start with a capital letter.', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // 'keyword "3" must be ascii and must start with a capital letter.', + /keyword .* must be ascii and must start with a capital letter./, }); zcf.assertUniqueKeyword('MyKeyword'); }); @@ -226,7 +250,13 @@ test(`zcf.saveIssuer - bad keyword`, async t => { await t.throwsAsync( async () => zcf.saveIssuer(moolaKit.issuer, 'bad keyword'), { - message: `keyword "bad keyword" must be ascii and must start with a capital letter.`, + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // `keyword "bad keyword" must be ascii and must start with a capital letter.`, + /keyword .* must be ascii and must start with a capital letter./, }, ); }); @@ -238,7 +268,7 @@ test(`zcf.saveIssuer - args reversed`, async t => { // https://github.com/Agoric/agoric-sdk/issues/1702 // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(async () => zcf.saveIssuer('A', moolaKit.issuer), { - message: `(an object) must be a string`, + message: /.* must be a string/, }); }); @@ -283,7 +313,7 @@ test(`zcf.makeInvitation - no description`, async t => { const { zcf } = await setupZCFTest(); // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcf.makeInvitation(() => {}), { - message: `invitations must have a description string: (an undefined)`, + message: /invitations must have a description string: "\[undefined\]"/, }); }); @@ -293,7 +323,7 @@ test(`zcf.makeInvitation - non-string description`, async t => { // https://github.com/Agoric/agoric-sdk/issues/1704 // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcf.makeInvitation(() => {}, { something: 'a' }), { - message: `invitations must have a description string: (an object)`, + message: /invitations must have a description string: .*/, }); }); @@ -348,7 +378,13 @@ test(`zcf.makeZCFMint - no keyword`, async t => { const { zcf } = await setupZCFTest(); // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(() => zcf.makeZCFMint(), { - message: '(an undefined) must be a string', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"\[undefined\]" must be a string/, + /.* must be a string/, }); }); @@ -356,14 +392,20 @@ test(`zcf.makeZCFMint - keyword already in use`, async t => { const { moolaIssuer } = setup(); const { zcf } = await setupZCFTest({ A: moolaIssuer }); await t.throwsAsync(() => zcf.makeZCFMint('A'), { - message: 'Keyword (a string) already registered', + message: /Keyword .* already registered/, }); }); test(`zcf.makeZCFMint - bad keyword`, async t => { const { zcf } = await setupZCFTest(); await t.throwsAsync(() => zcf.makeZCFMint('a'), { - message: 'keyword "a" must be ascii and must start with a capital letter.', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // 'keyword "a" must be ascii and must start with a capital letter.', + /keyword .* must be ascii and must start with a capital letter./, }); }); @@ -371,8 +413,7 @@ test(`zcf.makeZCFMint - not a math kind`, async t => { const { zcf } = await setupZCFTest(); // @ts-ignore deliberate invalid arguments for testing await t.throwsAsync(() => zcf.makeZCFMint('A', 'whatever'), { - message: - '(a string) must be MathKind.NAT or MathKind.SET. MathKind.STRING_SET is accepted but deprecated', + message: /.* must be MathKind.NAT or MathKind.SET. MathKind.STRING_SET is accepted but deprecated/, }); }); @@ -421,7 +462,7 @@ test(`zcf.makeZCFMint - mintGains - no args`, async t => { const zcfMint = await zcf.makeZCFMint('A', MathKind.SET); // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcfMint.mintGains(), { - message: `gains (an undefined) must be an amountKeywordRecord`, + message: /gains "\[undefined\]" must be an amountKeywordRecord/, }); }); @@ -445,7 +486,7 @@ test(`zcf.makeZCFMint - mintGains - no gains`, async t => { // https://github.com/Agoric/agoric-sdk/issues/1696 // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcfMint.mintGains(undefined, zcfSeat), { - message: 'gains (an undefined) must be an amountKeywordRecord', + message: /gains "\[undefined\]" must be an amountKeywordRecord/, }); }); @@ -454,7 +495,7 @@ test(`zcf.makeZCFMint - burnLosses - no args`, async t => { const zcfMint = await zcf.makeZCFMint('A', MathKind.SET); // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcfMint.burnLosses(), { - message: 'losses (an undefined) must be an amountKeywordRecord', + message: /losses "\[undefined\]" must be an amountKeywordRecord/, }); }); @@ -464,7 +505,7 @@ test(`zcf.makeZCFMint - burnLosses - no losses`, async t => { const { zcfSeat } = zcf.makeEmptySeatKit(); // @ts-ignore deliberate invalid arguments for testing t.throws(() => zcfMint.burnLosses(undefined, zcfSeat), { - message: 'losses (an undefined) must be an amountKeywordRecord', + message: /losses "\[undefined\]" must be an amountKeywordRecord/, }); }); @@ -475,7 +516,7 @@ test(`zcf.makeZCFMint - mintGains - wrong brand`, async t => { const zcfMint = await zcf.makeZCFMint('A', MathKind.SET); const { zcfSeat } = zcf.makeEmptySeatKit(); t.throws(() => zcfMint.mintGains({ Moola: moola(3) }, zcfSeat), { - message: `Only digital assets of brand (an object) can be minted in this call. (an object) has the wrong brand.`, + message: /Only digital assets of brand .* can be minted in this call. .* has the wrong brand./, }); }); @@ -486,7 +527,7 @@ test(`zcf.makeZCFMint - burnLosses - wrong brand`, async t => { const zcfMint = await zcf.makeZCFMint('A', MathKind.SET); const { zcfSeat } = zcf.makeEmptySeatKit(); t.throws(() => zcfMint.burnLosses({ Moola: moola(3) }, zcfSeat), { - message: `Only digital assets of brand (an object) can be burned in this call. (an object) has the wrong brand.`, + message: /Only digital assets of brand .* can be burned in this call. .* has the wrong brand./, }); }); @@ -1200,7 +1241,7 @@ test(`zcf.reallocate 3 seats, rights NOT conserved`, async t => { }); t.throws(() => zcf.reallocate(staging1, staging2, staging3), { - message: `rights were not conserved for brand (an object)`, + message: /rights were not conserved for brand .*/, }); t.deepEqual(zcfSeat1.getCurrentAllocation(), { diff --git a/packages/zoe/test/unitTests/zcf/test-zoeHelpersWZcf.js b/packages/zoe/test/unitTests/zcf/test-zoeHelpersWZcf.js index c22049abb9a..319e905b2ee 100644 --- a/packages/zoe/test/unitTests/zcf/test-zoeHelpersWZcf.js +++ b/packages/zoe/test/unitTests/zcf/test-zoeHelpersWZcf.js @@ -119,7 +119,7 @@ test.failing(`zcf assertUsesNatMath - not brand`, async t => { // TODO: distinguish non-brands from brands // https://github.com/Agoric/agoric-sdk/issues/1800 t.throws(() => assertUsesNatMath(zcf, issuer), { - message: /assertUsesNatMath requires a brand, not (an object)/, + message: /assertUsesNatMath requires a brand, not .*/, }); }); @@ -127,7 +127,13 @@ test(`zcf assertUsesNatMath - brand not registered`, async t => { const { zcf } = await setupZCFTest(); const { brand } = makeIssuerKit('gelt'); t.throws(() => assertUsesNatMath(zcf, brand), { - message: '"brand" not found: (an object)', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"brand" not found: .*/, + /.* not found: .*/, }); }); @@ -188,14 +194,26 @@ test(`zcf saveAllIssuers - duplicate keyword`, async t => { t.throws( () => zcf.getBrandForIssuer(pIssuer), { - message: '"issuer" not found: (an object)', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"issuer" not found: .*/, + /.* not found: .*/, }, 'issuer should not be found', ); t.notThrows(() => assertUsesNatMath(zcf, pandaBrand), 'default'); t.throws(() => assertUsesNatMath(zcf, pBrand), { - message: '"brand" not found: (an object)', + message: + // Should be able to use more informative error once SES double + // disclosure bug is fixed. See + // https://github.com/endojs/endo/pull/640 + // + // /"brand" not found: .*/, + /.* not found: .*/, }); }); @@ -220,28 +238,28 @@ test(`zoeHelper with zcf - assertIssuerKeywords`, async t => { t.throws( () => assertIssuerKeywords(zcf, []), { - message: 'keywords: (an object) were not as expected: (an object)', + message: /keywords: .* were not as expected: .*/, }, 'empty keywordRecord does not match', ); t.throws( () => assertIssuerKeywords(zcf, ['A']), { - message: 'keywords: (an object) were not as expected: (an object)', + message: /keywords: .* were not as expected: .*/, }, 'missing keyword from keywordRecord does not match', ); t.throws( () => assertIssuerKeywords(zcf, ['A', 'b']), { - message: 'keywords: (an object) were not as expected: (an object)', + message: /keywords: .* were not as expected: .*/, }, 'wrong keyword in keywordRecord does not match', ); t.throws( () => assertIssuerKeywords(zcf, ['A', 'B', 'C']), { - message: 'keywords: (an object) were not as expected: (an object)', + message: /keywords: .* were not as expected: .*/, }, 'extra keywords in keywordRecord does not match', ); @@ -281,7 +299,7 @@ test(`zoeHelper with zcf - assertProposalShape`, async t => { t.throws( () => assertProposalShape(zcfSeat, { want: { C: null } }), { - message: 'actual (an object) did not match expected (an object)', + message: /actual .* did not match expected .*/, }, 'empty keywordRecord does not match', ); @@ -290,14 +308,14 @@ test(`zoeHelper with zcf - assertProposalShape`, async t => { t.throws( () => assertProposalShape(zcfSeat, { give: { c: null } }), { - message: 'actual (an object) did not match expected (an object)', + message: /actual .* did not match expected .*/, }, 'wrong key in keywordRecord does not match', ); t.throws( () => assertProposalShape(zcfSeat, { exit: { onDemaind: null } }), { - message: 'actual (an object) did not match expected (an object)', + message: /actual .* did not match expected .*/, }, 'missing exit rule', ); @@ -514,6 +532,6 @@ test(`zcf/zoeHelper - assertProposalShape w/bad Expected`, async t => { // @ts-ignore invalid arguments for testing t.throws(() => assertProposalShape(zcfSeat, { give: { B: moola(3) } }), { - message: `The value of the expected record must be null but was (an object)`, + message: /The value of the expected record must be null but was .*/, }); });