You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem
I'm not 100% sure this is a bug but I think it probably is:
Given the following config (without using react-native-web babel plugin, using webpack 2):
Jest snapshots fail since the jest serializer is using StyleSheet from const { StyleSheet } = require('../dist');, whereas the components render using the ES6 StyleSheet built by webpack resulting in 2 different registries.
How to reproduce
Test case:
Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Environment (include versions). Did this work in previous versions?
OS: osX
Device:
Browser:
React Native for Web (version): 0.7.2
React (version): 16.2
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
What I'm thinking of doing is removing the serializer and making StyleSheet.create the identity function when NODE_ENV==='test'. That will be simpler (and work for either cjs or esm) and retain the array of styles in the snapshot. Eventually can provide this as part of a jest preset like React Native's that does things like mock out View too.
The problem
I'm not 100% sure this is a bug but I think it probably is:
Given the following config (without using react-native-web babel plugin, using webpack 2):
Jest snapshots fail since the jest serializer is using StyleSheet from
const { StyleSheet } = require('../dist');
, whereas the components render using the ES6 StyleSheet built by webpack resulting in 2 different registries.How to reproduce
Test case:
Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Environment (include versions). Did this work in previous versions?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: