Skip to content

add: simple array check to generateFormData #11

add: simple array check to generateFormData

add: simple array check to generateFormData #11

Triggered via pull request May 2, 2025 18:37
Status Failure
Total duration 35s
Artifacts

validate.yaml

on: pull_request
🔎 Type check
22s
🔎 Type check
⚡ Unit Tests
20s
⚡ Unit Tests
Fit to window
Zoom out
Zoom in

Annotations

3 errors
src/utilities/index.test.ts > getFormDataFromSearchParams > should convert array search params to FormData object with arrays: src/utilities/index.test.ts#L259
AssertionError: expected { 'colors[]': [ 'red', …(2) ], …(3) } to strictly equal { …(2) } - Expected + Received Object { - "colors": Array [ + "colors[]": Array [ "red", "green", "blue", ], - "numbers": Array [ - 1, - 2, - 3, - ], + "numbers[0]": 1, + "numbers[1]": 2, + "numbers[2]": 3, } ❯ src/utilities/index.test.ts:259:22
src/utilities/index.test.ts > getValidatedFormData > gets valid form data from a GET request: src/utilities/index.test.ts#L514
AssertionError: expected { …(3) } to strictly equal { data: { …(3) }, …(2) } - Expected + Received Object { - "data": Object { - "colors": Array [ - "red", - "green", - "blue", - ], - "numbers": Array [ - 1, - 2, - 3, - ], - "user": Object { - "name": "john", + "data": undefined, + "errors": Object { + "colors": Object { + "message": "Required", + "ref": undefined, + "type": "invalid_type", + }, + "numbers": Object { + "message": "Required", + "ref": undefined, + "type": "invalid_type", }, }, - "errors": undefined, "receivedValues": Object { - "colors": Array [ + "colors[]": Array [ "red", "green", "blue", ], - "numbers": Array [ - 1, - 2, - 3, - ], + "numbers[0]": 1, + "numbers[1]": 2, + "numbers[2]": 3, "user": Object { "name": "john", }, }, } ❯ src/utilities/index.test.ts:514:22
⚡ Unit Tests
Process completed with exit code 1.