Skip to content

Commit

Permalink
add test to spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kormanowsky authored Oct 3, 2024
1 parent b078db7 commit 633228b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ describe('distrib()', () => {
)
.toEqual([[1000, 0.06, 0.01], [700, 200, 100, 0.05, 0.02], [500, 500, 0.04, 0.03]]);
});
});

test('groups 1 big number, 1 medium and 4 small into 2 groups', () => {
expect(distrib([5, 5, 5, 5, 10, 20], 3)).toEqual([[20, 5], [10, 5, 5]]);

Check failure on line 20 in tests/spec.ts

View workflow job for this annotation

GitHub Actions / Jest Tests

distrib() ► distrib() groups 1 big number, 1 medium and 4 small into 2 groups ► distrib() groups 1 big number, 1 medium and 4 small into 2 groups

Failed test found in: reports/jest-junit.xml Error: Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 0
+ Received  + 1

@@ -5,7 +5,8 @@
    ],
    Array [
      10,
      5,
      5,
+     5,
    ],
  ]
    at Object.<anonymous> (/home/runner/work/distrib/distrib/tests/spec.ts:20:50)
    at Promise.then.completed (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/run.js:121:9)
    at run (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/distrib/distrib/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/distrib/distrib/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/distrib/distrib/node_modules/jest-runner/build/runTest.js:444:34)
});
});

0 comments on commit 633228b

Please sign in to comment.