Skip to content

feat: add custom fetch override #5024

feat: add custom fetch override

feat: add custom fetch override #5024

Triggered via pull request December 23, 2024 15:52
Status Failure
Total duration 3m 16s
Artifacts 2

ci.yaml

on: pull_request
Matrix: analyze-bundle
bundle-analyze-result
46s
bundle-analyze-result
Fit to window
Zoom out
Zoom in

Annotations

14 errors and 7 warnings
test/upload-button.test.tsx > UploadButton - basic > fetches and displays route config: packages/react/test/upload-button.test.tsx#L112
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready" Expected the element to have attribute: data-state="ready" Received: data-state="readying" Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ test/upload-button.test.tsx:112:39 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/upload-button.test.tsx > UploadButton - basic > fetches and displays route config (with callback endpoint arg): packages/react/test/upload-button.test.tsx#L132
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready" Expected the element to have attribute: data-state="ready" Received: data-state="readying" Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ test/upload-button.test.tsx:132:39 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/upload-button.test.tsx > UploadButton - basic > shows plural when maxFileCount is > 1: packages/react/test/upload-button.test.tsx#L150
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready" Expected the element to have attribute: data-state="ready" Received: data-state="readying" Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ test/upload-button.test.tsx:150:39 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/upload-button.test.tsx > UploadButton - basic > requests URLs when a file is selected: packages/react/test/upload-button.test.tsx#L167
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready" Expected the element to have attribute: data-state="ready" Received: data-state="readying" Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ test/upload-button.test.tsx:167:39 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/upload-button.test.tsx > UploadButton - basic > manual mode requires extra click: packages/react/test/upload-button.test.tsx#L195
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready" Expected the element to have attribute: data-state="ready" Received: data-state="readying" Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ test/upload-button.test.tsx:195:39 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/upload-button.test.tsx > UploadButton - lifecycle hooks > onBeforeUploadBegin alters the requested files: packages/react/test/upload-button.test.tsx#L233
TestingLibraryElementError: Unable to find an element with the text: Choose File. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27 ❯ test/upload-button.test.tsx:233:11
test/upload-button.test.tsx > UploadButton - lifecycle hooks > onUploadBegin runs before uploading: packages/react/test/upload-button.test.tsx#L256
TestingLibraryElementError: Unable to find an element with the text: Choose File(s). This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27 ❯ test/upload-button.test.tsx:256:11
test/upload-button.test.tsx > UploadButton - Theming > renders custom styles: packages/react/test/upload-button.test.tsx#L281
TestingLibraryElementError: Unable to find an element with the text: Choose File. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" style="background-color: red;" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> Ignored nodes: comments, script, style <html> <head /> <body> <div> <div class="flex flex-col items-center justify-center gap-1" data-state="readying" > <label class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400" data-state="readying" data-ut-element="button" style="background-color: red;" > <input accept="" class="sr-only" tabindex="0" type="file" /> Loading... </label> <div class="h-[1.25rem] text-xs leading-5 text-gray-600" data-state="readying" data-ut-element="allowed-content" /> </div> </div> </body> </html> ❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27 ❯ test/upload-button.test.tsx:281:11
test/client.test.ts > uploadFiles > uses custom fetch implementation if set: packages/uploadthing/test/client.test.ts#L250
AssertionError: expected "spy" to be called with arguments: [ Any<String>, ObjectContaining{…} ] Received: 1st spy call: Array [ - Any<String>, - ObjectContaining { - "body": Any<FormData>, + "http://localhost:39605/api/uploadthing?actionType=upload&slug=foo", + Object { + "body": "{\"files\":[{\"name\":\"foo.txt\",\"size\":3,\"type\":\"text/plain\",\"lastModified\":1734969336283}]}", + "headers": Headers { + Symbol(entries): Object { + "content-type": Object { + "name": "Content-Type", + "value": Array [ + "application/json", + ], + }, + "x-uploadthing-package": Object { + "name": "x-uploadthing-package", + "value": Array [ + "vitest", + ], + }, + "x-uploadthing-version": Object { + "name": "x-uploadthing-version", + "value": Array [ + "7.4.1", + ], + }, + }, + }, "method": "POST", + "signal": AbortSignal { + "aborted": false, + "onabort": null, + "reason": null, + Symbol(listeners): Object { + "abort": Array [ + [Function anonymous], + [Function abort], + ], + }, + Symbol(listenerOptions): Object { + "abort": Array [ + Object { + "once": true, + }, + Object { + "once": true, + }, + ], + }, + }, }, ] 2nd spy call: Array [ - Any<String>, - ObjectContaining { - "body": Any<FormData>, - "method": "POST", + "https://fra1.ingest.uploadthing.com/u7rKiJYp268sQrjyl3cc2DHM7ZGTOa6Jxhr8FojUqIyXbAB4?expires=1734972936309&x-ut-identifier=app-1&x-ut-file-name=foo.txt&x-ut-file-size=3&x-ut-file-type=text%252Fplain&x-ut-slug=foo&x-ut-content-disposition=inline&signature=hmac-sha256%3D5fd81b653c1f235fba5009b100efaf53f9c491f311a205766cb60747a81a3215", + Object { + "headers": Headers { + Symbol(entries): Object {}, + }, + "method": "HEAD", + "signal": AbortSignal { + "aborted": false, + "onabort": null, + "reason": null, + Symbol(listeners): Object { + "abort": Array [ + [Function anonymous], + ], + }, + Symbol(listenerOptions): Object { + "abort": Array [ + Object { + "once": true, + }, + ], + }, + }, }, ] Number of calls: 2 ❯ test/client.test.ts:250:21
build
Process completed with exit code 1.
typecheck
Argument of type 'string | number | symbol' is not assignable to parameter of type 'EndpointArg<FileRouter, string>'.
typecheck
Argument of type 'string | number | symbol' is not assignable to parameter of type 'EndpointArg<FileRouter, string>'.
typecheck
@uploadthing/expo#typecheck: command (/home/runner/work/uploadthing/uploadthing/packages/expo) /home/runner/setup-pnpm/node_modules/.bin/pnpm run typecheck exited (2)
typecheck
Process completed with exit code 2.
analyze-bundle (main)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
format
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
analyze-bundle (current-pr)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
bundle-analyze-result
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
build
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
lint
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
typecheck
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636

Artifacts

Produced during runtime
Name Size
bundle-current-pr
45.3 KB
bundle-main
45.4 KB