Skip to content

Commit

Permalink
Merge pull request #1770 from endojs/ta/test-splitRecord
Browse files Browse the repository at this point in the history
test: additional tests of splitRecord
  • Loading branch information
turadg authored Sep 14, 2023
2 parents 4a7f980 + ff2d753 commit 66bb24c
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 66bb24c

Please sign in to comment.