-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
Running this test:
diff --git a/packages/core/src/utils/__tests__/distribute.test.ts b/packages/core/src/utils/__tests__/distribute.test.ts
index c27c022..fc70529 100644
--- a/packages/core/src/utils/__tests__/distribute.test.ts
+++ b/packages/core/src/utils/__tests__/distribute.test.ts
@@ -29,4 +29,7 @@ describe('distribute', () => {
it('distributes to empty ratios', () => {
expect(distributeFn(1003, [])).toEqual([]);
});
+ it('distributes remainder to the largest ratio', () => {
+ expect(distributeFn(5, [100, 101, 100, 100])).toEqual([1, 2, 1, 1]);
+ });
});
Should pass, since the largest remaining divisor should receive the remainder, but the test fails because the remainder is just allocated to the first partition.
Expected behavior
expect(distributeFn(5, [100, 101, 100, 100])).toEqual([1, 2, 1, 1]);
Steps to reproduce
- apply the patch
- run tests
- profit
Version
v2.0.0-alpha.9
Environment
node.js 18
Code of Conduct
- I agree to follow this project's Code of Conduct
CanRauCanRau
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working