Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: also export the type Test #57

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ declare namespace uvu {
}

type Context = Record<string, any>;
export const test: uvu.Test<Context>;

export type Test<T=Context> = uvu.Test<T>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have this exposed because of the generic naming.
But now that it is, what do you think about using the Suite name instead, since that's what it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you could argue the same thing with Callback. To me the suite, is the collection of test's (at least mentally), and a Test is the individual units. Seeing as suite() returns a uvu.Test it's only fitting to also export that type.

Its like you don't share suites, you share tests. I know its the same thing—but i still believe the naming her is right.

export type Callback<T=Context> = uvu.Callback<T>;

export const test: uvu.Test<Context>;
export function suite<T=Context>(title?: string, context?: T): uvu.Test<T>;
export function exec(bail?: boolean): Promise<void>;