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;
}
function makeTransaction({ splitFreq = 1, payeeIds } = {}) {
function makeTransaction({ splitFreq = 100, payeeIds } = {}) {
let payeeField = payeeIds
? { payee: fc.oneof(...payeeIds.map(id => fc.constant(id))) }
: null;
@ -128,7 +128,7 @@ function makeTransaction({ splitFreq = 1, payeeIds } = {}) {
{
...payeeField,
subtransactions: fc.frequency(
{ arbitrary: fc.constant([]), weight: 1 },
{ arbitrary: fc.constant([]), weight: 100 },
{ arbitrary: fc.array(subtrans), weight: splitFreq }
)
},

View file

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