From 2846166a8e6f85984fa743ff5693989f0ff2086c Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 8 Jul 2022 21:19:48 +0100 Subject: [PATCH] fix: revert changes to weights and pin fast-check version to 2.13.0 --- packages/loot-core/package.json | 2 +- .../loot-core/src/mocks/arbitrary-schema.js | 4 ++-- yarn.lock | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json index 2529a5f..4e6fffd 100644 --- a/packages/loot-core/package.json +++ b/packages/loot-core/package.json @@ -28,7 +28,7 @@ "csv-parse": "^4.10.1", "csv-stringify": "^5.3.6", "deep-equal": "^2.0.5", - "fast-check": "^2.11.0", + "fast-check": "2.13.0", "google-protobuf": "^3.12.0-rc.1", "md5": "^2.3.0", "mitt": "^2.1.0", diff --git a/packages/loot-core/src/mocks/arbitrary-schema.js b/packages/loot-core/src/mocks/arbitrary-schema.js index f080582..2d7fdf7 100644 --- a/packages/loot-core/src/mocks/arbitrary-schema.js +++ b/packages/loot-core/src/mocks/arbitrary-schema.js @@ -116,7 +116,7 @@ function tableArbitrary(tableSchema, extraArbs, requiredKeys = []) { return arb; } -function makeTransaction({ splitFreq = 100, payeeIds } = {}) { +function makeTransaction({ splitFreq = 0.1, payeeIds } = {}) { let payeeField = payeeIds ? { payee: fc.oneof(...payeeIds.map(id => fc.constant(id))) } : null; @@ -128,7 +128,7 @@ function makeTransaction({ splitFreq = 100, payeeIds } = {}) { { ...payeeField, subtransactions: fc.frequency( - { arbitrary: fc.constant([]), weight: 100 }, + { arbitrary: fc.constant([]), weight: 1 }, { arbitrary: fc.array(subtrans), weight: splitFreq } ) }, diff --git a/yarn.lock b/yarn.lock index f18d9df..207b184 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7230,12 +7230,12 @@ fake-indexeddb@^3.1.3: dependencies: realistic-structured-clone "^2.0.1" -fast-check@^2.11.0: - version "2.23.2" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-2.23.2.tgz#375c01827a9d58916c8a0ad463d1f17fe8e6ae4b" - integrity sha512-ECYuSlp6NLpvOj8eScKsqoz1ihtCpSDuEC2ofdGvgsEu1obHYEGqreJ/iPzkJFy73yoU0kCFea7PHUQDNM0VNg== +fast-check@2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-2.13.0.tgz#92a50a6a39b58760d4b0b52b12f98f28a9f020f6" + integrity sha512-IOfzKm/SCA+jpUEgAfqAuxHYPmgtmpnnwljQmYPRGrqYczcTKApXKHza/SNxFxYkecWfZilYa0DJdBvqz1bcSw== dependencies: - pure-rand "^5.0.1" + pure-rand "^4.1.1" fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" @@ -13649,10 +13649,10 @@ pupa@^2.1.1: dependencies: escape-goat "^2.0.0" -pure-rand@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-5.0.1.tgz#97a287b4b4960b2a3448c0932bf28f2405cac51d" - integrity sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ== +pure-rand@^4.1.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-4.2.1.tgz#14c08ab1cebce0eb95b987638039742a1006a695" + integrity sha512-ESI2eqHP9JlrnTb7H7fgczRUWB6VxMMJ2m9870WCIBhYkBzSGd6gml6WhQVXHK+ZM8k70TqsyI28ixaLPaNz5g== q@^1.1.2: version "1.5.1"