Skip to content

Commit

Permalink
test: additional tests of splitRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 14, 2023
1 parent 4a7f980 commit ff2d753
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/patterns/test/test-patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,18 @@ const runTests = (t, successCase, failCase) => {
'{"bar":4,"foo":3} - Must be >= {"baz":3}',
);

successCase(specimen, M.splitRecord({}, undefined, undefined));
successCase(specimen, M.splitRecord({}, { unused: M.string() }));
failCase(
specimen,
M.splitRecord({ foo: M.number() }, { bar: M.string(), baz: M.number() }),
'bar?: number 4 - Must be a string',
);
failCase(
specimen,
M.splitRecord({}, { unused: M.string() }, M.string()),
'...rest: copyRecord {"bar":4,"foo":3} - Must be a string',
);

failCase(
specimen,
Expand Down

0 comments on commit ff2d753

Please sign in to comment.