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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type defs for a suite takes a context #56

Merged
merged 3 commits into from Nov 2, 2020
Merged

fix: type defs for a suite takes a context #56

merged 3 commits into from Nov 2, 2020

Conversation

maraisr
Copy link
Sponsor Contributor

@maraisr maraisr commented Nov 2, 2020

You don't pass a suite to the suite method, you pass a context. 馃憖

@codecov-io
Copy link

Codecov Report

Merging #56 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #56   +/-   ##
=======================================
  Coverage   90.16%   90.16%           
=======================================
  Files           3        3           
  Lines         305      305           
=======================================
  Hits          275      275           
  Misses         30       30           

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 30c10e0...094da36. Read the comment docs.

src/index.d.ts Outdated
@@ -19,5 +19,5 @@ declare namespace uvu {
type Context = Record<string, any>;
export const test: uvu.Test<Context>;
export type Callback<T=Context> = uvu.Callback<T>;
export function suite<T=Context>(title?: string, suite?: T): uvu.Test<T>;
export function suite<T=Context>(title?: string, context?: Partial<T>): uvu.Test<T>;
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

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

What do you think about this Partial @lukeed? I wanted this to be stuff like sync config, that get's enhanced by future before's... But don't want to have TS say context?.myThing always, but making the property be myThing?: string for example.

Copy link
Owner

Choose a reason for hiding this comment

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

It can't be enforced here. It's just forwarding whatever you decide the context contains. Entirely up to you & uvu types shouldn't mess with that.

@lukeed
Copy link
Owner

lukeed commented Nov 2, 2020

Oops, thanks :)

@lukeed lukeed merged commit d2f2504 into lukeed:master Nov 2, 2020
@maraisr maraisr deleted the patch-1 branch November 2, 2020 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants