Skip to content

Commit

Permalink
export errors and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Arrowood committed Nov 5, 2020
1 parent 6d29e43 commit 1ccef77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ declare function Undici(url: string, opts: Pool.Options): Pool
declare namespace Undici {
var Pool: typeof import('./types/pool');
var Client: typeof import('./types/client');
var errors: typeof import('./types/errors');
}
2 changes: 1 addition & 1 deletion test/types/client.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ expectAssignable<Client>(new Client('', {}))
}))

// dispatch
expectAssignable<PromiseLike<void> | void>(client.dispatch({ path: '', method: '' }, {}))
expectAssignable<void>(client.dispatch({ path: '', method: '' }, {}))

// close
expectAssignable<PromiseLike<void>>(client.close())
Expand Down
1 change: 1 addition & 0 deletions test/types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ import Undici, { Pool, Client, Errors } from '../..'
expectAssignable<Pool>(Undici('', {}))
expectAssignable<Pool>(new Undici.Pool('', {}))
expectAssignable<Client>(new Undici.Client('', {}))
expectAssignable<typeof Errors>(Undici.errors)
2 changes: 1 addition & 1 deletion test/types/pool.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ expectAssignable<Pool>(new Pool('', {}))
}))

// dispatch
expectAssignable<PromiseLike<void> | void>(pool.dispatch({ path: '', method: '' }, {}))
expectAssignable<void>(pool.dispatch({ path: '', method: '' }, {}))

// close
expectAssignable<PromiseLike<void>>(pool.close())
Expand Down

0 comments on commit 1ccef77

Please sign in to comment.