From 815413e48c86b76fb187134660ea5e6915005489 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins <matiss@mja.lv> Date: Fri, 17 Mar 2023 18:37:02 +0000 Subject: [PATCH] :white_check_mark: reducing flakiness of tests by removing randomization (#771) This is not a full fix for the flakiness. One of the test cases will still be flaky. But at least this fixes the other test cases thus improving stability. --- packages/loot-core/src/mocks/index.js | 5 ++--- upcoming-release-notes/771.md | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 upcoming-release-notes/771.md diff --git a/packages/loot-core/src/mocks/index.js b/packages/loot-core/src/mocks/index.js index 5be16f256..fc3b12662 100644 --- a/packages/loot-core/src/mocks/index.js +++ b/packages/loot-core/src/mocks/index.js @@ -55,9 +55,8 @@ function _generateTransaction(data) { return { id: id, amount: data.amount || Math.floor(Math.random() * 10000 - 7000), - payee: data.payee || (Math.random() < 0.9 ? 'payed-to' : 'guy'), - notes: - Math.random() < 0.1 ? 'A really long note that should overflow' : 'Notes', + payee: data.payee || 'payed-to', + notes: 'Notes', account: data.account, date: data.date || monthUtils.currentDay(), category: data.category, diff --git a/upcoming-release-notes/771.md b/upcoming-release-notes/771.md new file mode 100644 index 000000000..522cc09f8 --- /dev/null +++ b/upcoming-release-notes/771.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Reducing unit test flakiness by removing randomization -- GitLab