test: make all frequency weights be integer values

This commit is contained in:
Tom French 2022-06-27 01:20:14 +01:00
parent b4696ce598
commit c94749aace
2 changed files with 3 additions and 3 deletions

View file

@ -116,7 +116,7 @@ function tableArbitrary(tableSchema, extraArbs, requiredKeys = []) {
return arb; return arb;
} }
function makeTransaction({ splitFreq = 1, payeeIds } = {}) { function makeTransaction({ splitFreq = 100, payeeIds } = {}) {
let payeeField = payeeIds let payeeField = payeeIds
? { payee: fc.oneof(...payeeIds.map(id => fc.constant(id))) } ? { payee: fc.oneof(...payeeIds.map(id => fc.constant(id))) }
: null; : null;
@ -128,7 +128,7 @@ function makeTransaction({ splitFreq = 1, payeeIds } = {}) {
{ {
...payeeField, ...payeeField,
subtransactions: fc.frequency( subtransactions: fc.frequency(
{ arbitrary: fc.constant([]), weight: 1 }, { arbitrary: fc.constant([]), weight: 100 },
{ arbitrary: fc.array(subtrans), weight: splitFreq } { arbitrary: fc.array(subtrans), weight: splitFreq }
) )
}, },

View file

@ -319,7 +319,7 @@ describe('transaction executors', () => {
fc fc
.asyncProperty( .asyncProperty(
arbs.makeTransactionArray({ arbs.makeTransactionArray({
splitFreq: 0.1, splitFreq: 10,
payeeIds, payeeIds,
maxLength: 100 maxLength: 100
}), }),