Skip to content
Snippets Groups Projects
Commit c94749aa authored by Tom French's avatar Tom French
Browse files

test: make all frequency weights be integer values

parent b4696ce5
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,7 @@ function tableArbitrary(tableSchema, extraArbs, requiredKeys = []) { ...@@ -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 } = {}) { ...@@ -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 }
) )
}, },
......
...@@ -319,7 +319,7 @@ describe('transaction executors', () => { ...@@ -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
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment