@@ -6,7 +6,7 @@ import { pipeline, Readable } from 'stream'
66import * as fs from 'fs'
77import { expectError , expectType } from 'tsd'
88import { FastifyErrorConstructor } from "fastify-error"
9- import { BusboyConfig } from "@fastify/busboy" ;
9+ import { BusboyConfig , BusboyFileStream } from "@fastify/busboy" ;
1010
1111const pump = util . promisify ( pipeline )
1212
@@ -56,7 +56,8 @@ const runServer = async () => {
5656 app . post ( '/' , async ( req , reply ) => {
5757 const data = await req . file ( )
5858
59- expectType < Readable > ( data . file )
59+ expectType < BusboyFileStream > ( data . file )
60+ expectType < boolean > ( data . file . truncated )
6061 expectType < MultipartFields > ( data . fields )
6162 expectType < string > ( data . fieldname )
6263 expectType < string > ( data . filename )
@@ -73,7 +74,7 @@ const runServer = async () => {
7374 expectError ( req . body . foo . file ) ;
7475 expectType < string > ( req . body . foo . value ) ;
7576
76- expectType < Readable > ( req . body . file . file )
77+ expectType < BusboyFileStream > ( req . body . file . file )
7778 expectError ( req . body . file . value ) ;
7879 reply . send ( ) ;
7980 } )
@@ -83,7 +84,7 @@ const runServer = async () => {
8384 reply . send ( ) ;
8485
8586 // file is a file
86- expectType < Readable > ( req . body . file . file )
87+ expectType < BusboyFileStream > ( req . body . file . file )
8788 expectError ( req . body . file . value ) ;
8889 } )
8990
0 commit comments