Skip to content

feat: provide context to beforeAll, afterAll and aroundAll hooks#9553

Closed
sheremet-va wants to merge 1 commit intographite-base/9553from
01-29-feat_provide_context_to_beforeall_afterall_and_aroundall_hooks
Closed

feat: provide context to beforeAll, afterAll and aroundAll hooks#9553
sheremet-va wants to merge 1 commit intographite-base/9553from
01-29-feat_provide_context_to_beforeall_afterall_and_aroundall_hooks

Conversation

@sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jan 29, 2026

Description

Resolves #issue-number

Next PR - timeout in fixtures, mergeTests and maybe refactor of fixture support - I get lost in what is going in this feature at this point

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@sheremet-va sheremet-va requested a review from hi-ogawa January 29, 2026 20:10
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sheremet-va
Copy link
Member Author

This proves to be rather difficult...

@sheremet-va sheremet-va force-pushed the 01-29-feat_provide_context_to_beforeall_afterall_and_aroundall_hooks branch from a3cde95 to 4b720c3 Compare January 29, 2026 20:34
@sheremet-va sheremet-va force-pushed the 01-29-feat_provide_context_to_beforeall_afterall_and_aroundall_hooks branch from 4b720c3 to 52b819d Compare January 29, 2026 20:42
@sheremet-va sheremet-va requested a review from hi-ogawa January 29, 2026 20:50
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

lgtm. A bit confused by override fixture and suite hook fixture, but seems reasonable. While testing around, I found a few more test cases which might be beneficial.

expect(tests).toMatchInlineSnapshot(`" ✓ basic.test.ts > test1 <time>"`)
})

test('test.override fixtures are scoped to their suite in beforeAll/afterAll', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add test cases with reverse order? The behavior turns out to be the same.

extendedTest.beforeAll({ value }) ...)

extendedTest.override('value', ...)

@sheremet-va sheremet-va changed the base branch from 01-29-feat_support_type_inference_with_new_test.extend_syntax to graphite-base/9553 January 30, 2026 07:57
@hi-ogawa
Copy link
Contributor

What I found while testing around was this #9555. Created a separate issue since it was same on main.

@sheremet-va
Copy link
Member Author

What I found while testing around was this #9555. Created a separate issue since it was same on main.

I actually fixed that in #9550, I think. Shouldn't fixture-initialize already fail though?

@sheremet-va
Copy link
Member Author

sheremet-va commented Jan 30, 2026

What I found while testing around was this #9555. Created a separate issue since it was same on main.

I actually fixed that in #9550, I think. Shouldn't fixture-initialize already fail though?

Ah, now I see it's scoped. Let's fix it in the other pr

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.

2 participants