1- import { expectType } from 'tsd' ;
1+ import { expectType , expectError } from 'tsd' ;
22import findUp = require( '.' ) ;
33
44expectType < Promise < string | undefined > > ( findUp ( 'unicorn.png' ) ) ;
@@ -9,19 +9,20 @@ expectType<Promise<string | undefined>>(findUp(['rainbow.png', 'unicorn.png'], {
99expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : false } ) ) ;
1010expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'file' } ) ) ;
1111expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'directory' } ) ) ;
12+ expectError ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { concurrency : 1 } ) )
1213
1314expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' ) ) ;
1415expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
1516expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined ) ) ;
1617expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { cwd : '' } ) ) ;
17- expectType < Promise < string | undefined > > ( findUp ( ( ) => findUp . stop ) ) ;
18- expectType < Promise < string | undefined > > ( findUp ( ( ) => findUp . stop , { cwd : '' } ) ) ;
18+ expectType < Promise < string | undefined > > ( findUp ( ( ) : findUp . StopSymbol => findUp . stop ) ) ;
19+ expectType < Promise < string | undefined > > ( findUp ( ( ) : findUp . StopSymbol => findUp . stop , { cwd : '' } ) ) ;
1920expectType < Promise < string | undefined > > ( findUp ( async ( ) => 'unicorn.png' ) ) ;
2021expectType < Promise < string | undefined > > ( findUp ( async ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
2122expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined ) ) ;
2223expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { cwd : '' } ) ) ;
23- expectType < Promise < string | undefined > > ( findUp ( async ( ) => findUp . stop ) ) ;
24- expectType < Promise < string | undefined > > ( findUp ( async ( ) => findUp . stop , { cwd : '' } ) ) ;
24+ expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < findUp . StopSymbol > => findUp . stop ) ) ;
25+ expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < findUp . StopSymbol > => findUp . stop , { cwd : '' } ) ) ;
2526
2627expectType < string | undefined > ( findUp . sync ( 'unicorn.png' ) ) ;
2728expectType < string | undefined > ( findUp . sync ( 'unicorn.png' , { cwd : '' } ) ) ;
@@ -36,7 +37,7 @@ expectType<string | undefined>(findUp.sync(() => 'unicorn.png'));
3637expectType < string | undefined > ( findUp . sync ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
3738expectType < string | undefined > ( findUp . sync ( ( ) => undefined ) ) ;
3839expectType < string | undefined > ( findUp . sync ( ( ) => undefined , { cwd : '' } ) ) ;
39- expectType < string | undefined > ( findUp . sync ( ( ) => findUp . stop ) ) ;
40- expectType < string | undefined > ( findUp . sync ( ( ) => findUp . stop , { cwd : '' } ) ) ;
40+ expectType < string | undefined > ( findUp . sync ( ( ) : findUp . StopSymbol => findUp . stop ) ) ;
41+ expectType < string | undefined > ( findUp . sync ( ( ) : findUp . StopSymbol => findUp . stop , { cwd : '' } ) ) ;
4142
4243expectType < Symbol > ( findUp . stop ) ;
0 commit comments