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

fix: add_hook and add_test handling #76

Merged
merged 1 commit into from
Apr 27, 2024
Merged

Conversation

noomorph
Copy link
Collaborator

I noticed that in an flat test file:

// my.test.js
metadata.set('key', 'value');

for some weird reason gets assigned to a hook, and not to ROOT_DESCRIBE_BLOCK, like I'd expect initially.

It turned out that my handling of add_hook and add_test was slightly incorrect – they should not permanently set currentMetadata to a test/hook definition.

So, what I'm doing now is to set a special listener which fires last and re-focuses the current metadata to the current describe block. This should help.

@noomorph noomorph merged commit f21fd9e into master Apr 27, 2024
6 checks passed
@noomorph noomorph deleted the fix/add-hook-test-events branch April 27, 2024 08:34
Copy link

🎉 This PR is included in version 1.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant