We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Extending context means that a sub-group of tests want to have the parent group context plus some more. Currently achieved via cumbersome means:
const ctx = konn.beforeEach(() => ({ a: 1 })) describe('sub', () => { const ctx2 = konn().beforeEach(() => ctx2) })
I fact this probably won't even work, consider the mixing of beforeAll and beforeEach
beforeAll
beforeEach
const ctx = konn.beforeEach(() => ({ a: 1 })) describe('sub', () => { const ctx2 = konn().beforeAll(() => ctx2).beforeAll((ctx) => ctx.a /* <-- bug! (undefined at runtime, statically appears there) */ ) })
That looks like trouble.
A first class way to extend context:
const ctx = konn.beforeEach(() => ({ a: 1 })) describe('sub', () => { const ctx2 = konn(ctx).beforeAll((ctx) => ctx.a /* <-- statically undefined, good, agrees with runtime */ ) })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Perceived Problem
Extending context means that a sub-group of tests want to have the parent group context plus some more. Currently achieved via cumbersome means:
I fact this probably won't even work, consider the mixing of
beforeAll
andbeforeEach
That looks like trouble.
Ideas / Proposed Solution(s)
A first class way to extend context:
The text was updated successfully, but these errors were encountered: