Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/utilities/__tests__/validateInputValue-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ describe('validateInputValue', () => {
});

it('returns no error for a valid iterable input', () => {
// TODO: put an error in this list and show it appears
function* listGenerator() {
yield 1;
yield 2;
Expand All @@ -507,6 +506,26 @@ describe('validateInputValue', () => {
test(listGenerator(), TestList, []);
});

it('returns an error for an invalid iterable input', () => {
function* listGenerator() {
yield 1;
yield 'b';
yield true;
yield 4;
}

test(listGenerator(), TestList, [
{
error: 'Int cannot represent non-integer value: "b"',
path: [1],
},
{
error: 'Int cannot represent non-integer value: true',
path: [2],
},
]);
});

it('returns an error for an invalid input', () => {
test([1, 'b', true, 4], TestList, [
{
Expand Down