Unable to add @fluentui/jest-serializer-merge-styles as snapshot serializer within storyshot #16249
Answered
by
ecraig12345
froila Dsouza (fhdsouza)
asked this question in
Q&A
|
Im trying to have storyshots included within storybook with our fluentUI components. I need to enable snapshotSerializer as a fluent provided serializer but I get the error: Type 'string' is not assignable to type 'Plugin' below. As per storyshot documentation, Im supposed to add it here as it is ignored if added in the jest.config file. Im using: Here's my setup file: |
Answered by
ecraig12345
Dec 16, 2020
Replies: 1 comment 2 replies
|
Based on both the type error and the storyshots plugin documentation, it looks like you need to pass a serializer plugin object (not the name of a serializer plugin) in this context. import * as jestSerializerMergeStyles from '@fluentui/jest-serializer-merge-styles';
// ...
initStoryshots({
snapshotSerializers: [jestSerializerMergeStyles],
// ...
}); |
2 replies
Answer selected by
micahgodbolt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on both the type error and the storyshots plugin documentation, it looks like you need to pass a serializer plugin object (not the name of a serializer plugin) in this context.