forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix context in directive tests (redwoodjs#9025)
**Problem** Context isolation was not behaving as expect when using directive tests. See https://community.redwoodjs.com/t/redwood-v6-0-0-upgrade-guide/5044/46 for more details. **Changes** 1. We set the global context to match the context passed in to the `mockRedwoodDirective` and then the mock directive gets the global context during execution. **Notes** It looks like in v5 we didn't pass through the context that was provided as a parameter to `mockRedwoodDirective`. It can be somewhat tricky to understand exactly what is happening due to a few layers and that in <v6 the context was not isolated between tests. **Outstanding** 1. People may not fully expect the side effect that passing in the context to the mock directive sets the global context?
- Loading branch information
1 parent
58a2421
commit 2ce3189
Showing
2 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters