Skip to content

Commit 57a7cec

Browse files
committed
fix node
1 parent ee2f6f0 commit 57a7cec

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: pnpm/action-setup@v4
2727
- uses: actions/setup-node@v4
2828
with:
29-
node-version: 18
29+
node-version: 18.13
3030
cache: "pnpm"
3131
- run: pnpm install
3232
- run: pnpm test:coverage

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"devDependencies": {
2424
"@biomejs/biome": "1.9.3",
2525
"@tinyhttp/app": "^2.4.0",
26-
"@types/node": "^22.7.4",
26+
"@types/node": "^18.19.76",
2727
"c8": "10.1.2",
2828
"supertest-fetch": "^2.0.0",
2929
"tsx": "^4.19.1",

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import assert from 'node:assert/strict'
22
import { Buffer } from 'node:buffer'
3+
import { File } from 'node:buffer'
34
import { createServer } from 'node:http'
45
import { describe, it } from 'node:test'
56
import { App } from '@tinyhttp/app'
@@ -353,7 +354,7 @@ describe('Multipart', () => {
353354
it('should parse multipart with files', async () => {
354355
const fd = new FormData()
355356
const file = new File(['hello world'], 'hello.txt', { type: 'text/plain' })
356-
fd.set('file', file)
357+
fd.set('file', file as Blob)
357358
const server = createServer(async (req: ReqWithBody<{ file: [File] }>, res) => {
358359
await multipart()(req, res, (err) => err && console.log(err))
359360

@@ -380,8 +381,8 @@ describe('Multipart', () => {
380381
new File(['bye world'], 'bye.txt', { type: 'text/plain' })
381382
]
382383

383-
fd.set('file1', files[0])
384-
fd.set('file2', files[1])
384+
fd.set('file1', files[0] as Blob)
385+
fd.set('file2', files[1] as Blob)
385386

386387
const server = createServer(async (req: ReqWithBody<{ file1: [File]; file2: [File] }>, res) => {
387388
await multipart()(req, res, (err) => err && console.log(err))
@@ -405,7 +406,7 @@ describe('Multipart', () => {
405406
it('should support binary files', async () => {
406407
const fd = new FormData()
407408
const file = new File([new Uint8Array([1, 2, 3])], 'blob.bin', { type: 'application/octet-stream' })
408-
fd.set('file', file)
409+
fd.set('file', file as Blob)
409410

410411
const server = createServer(async (req: ReqWithBody<{ file: [File] }>, res) => {
411412
await multipart()(req, res, (err) => err && console.log(err))
@@ -495,8 +496,8 @@ describe('Limits', () => {
495496

496497
const fd = new FormData()
497498

498-
fd.set('file1', new File(['hello world'], 'hello.txt', { type: 'text/plain' }))
499-
fd.set('file2', new File(['bye world'], 'bye.txt', { type: 'text/plain' }))
499+
fd.set('file1', new File(['hello world'], 'hello.txt', { type: 'text/plain' }) as Blob)
500+
fd.set('file2', new File(['bye world'], 'bye.txt', { type: 'text/plain' }) as Blob)
500501

501502
await makeFetch(server)('/', {
502503
body: fd,
@@ -514,7 +515,7 @@ describe('Limits', () => {
514515

515516
const fd = new FormData()
516517

517-
fd.set('file', new File(['hello world'], 'hello.txt', { type: 'text/plain' }))
518+
fd.set('file', new File(['hello world'], 'hello.txt', { type: 'text/plain' }) as Blob)
518519

519520
await makeFetch(server)('/', {
520521
body: fd,
@@ -534,7 +535,7 @@ describe('Limits', () => {
534535

535536
const fd = new FormData()
536537

537-
fd.set('file', new File(['hello world to everyone'], 'hello.txt', { type: 'text/plain' }))
538+
fd.set('file', new File(['hello world to everyone'], 'hello.txt', { type: 'text/plain' }) as Blob)
538539

539540
await makeFetch(server)('/', {
540541
body: fd,

0 commit comments

Comments
 (0)