How to set up @master/styles correctly in test enviroment? #15
Closed
mockingjet
started this conversation in
Question
Replies: 1 comment
|
@mockingjet Sorry for missing this. You can see how
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
First, let me make it clear that I don't think it is required to test components with @master/styles. What I did below is testing if @master/styles turns classes into styles, which should be tested by @master/styles, not me. I should only test what I implement ( in the case below, I should test
expect(iconEl).toHaveClass("b:1");). But I am still curious about it's feasibilty.So I start my test with importing @master/styles in a setup file
And then assert component's styles
The test result:

Maybe @master/style uses some underlying features / mechanism that jest enviroment doesn't support, or it's just my setup went wrong. We should have document / tutorial for this topic (even if it's not recommended to test this way).
All reactions