Skip to content

[Bug] beforeEach is not run inside component context #340

@Jakeii

Description

@Jakeii

Describe the bug

Updating reactive state or contexts doesn't work from the beforeEach function.

This would be useful for changing context mocks between stories in the same file.

Steps to reproduce the behavior

  1. Create a story
  2. attempt to update a $state rune inside beforeEach -> reactivtity won't work, attempting to use getContext/setContext will also throw an error

Expected behavior

That the beforeEach function is run inside the context of the Story component, I've noticed there's some code to do this for the play function, can it be done for beforeEach too? Doesn't seem possible from play either

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions