从jest和react-native-web寻求更易读的className差异

时间:2017-11-09 14:35:39

标签: reactjs react-native diff jestjs react-native-web

我正在使用Jest进行快照测试的react-native-web应用程序。它运作得很好!我遇到的唯一真正问题是我的className行差异是边缘不可读的。这是一个例子:

    <div
  -  className="rn-WebkitFontSmoothing-1vzmqqg rn-borderTopWidth-13yce4e rn-borderRightWidth-fnigne rn-borderBottomWidth-ndvcnb rn-borderLeftWidth-gxnn5r rn-boxSizing-deolkf rn-color-1qtguxu rn-display-1471scf rn-font-1lw9tu2 rn-fontFamily-1ee1ikv rn-fontSize-1enofrn rn-letterSpacing-196qbc9 rn-lineHeight-56xrmm rn-marginTop-1mnahxq rn-marginRight-61z16t rn-marginBottom-p1pxzi rn-marginLeft-11wrixw rn-paddingTop-wk8lta rn-paddingRight-9aemit rn-paddingBottom-1mdbw0j rn-paddingLeft-gy4na3 rn-textDecoration-bauka4 rn-textShadow-14hblb1 rn-whiteSpace-q42fyq rn-wordWrap-qvutc0"
  +  className="rn-WebkitFontSmoothing-1vzmqqg rn-borderTopWidth-13yce4e rn-borderRightWidth-fnigne rn-borderBottomWidth-ndvcnb rn-borderLeftWidth-gxnn5r rn-boxSizing-deolkf rn-color-homxoj rn-display-1471scf rn-font-1lw9tu2 rn-fontFamily-1ee1ikv rn-fontSize-1enofrn rn-letterSpacing-196qbc9 rn-lineHeight-56xrmm rn-marginTop-1mnahxq rn-marginRight-61z16t rn-marginBottom-p1pxzi rn-marginLeft-11wrixw rn-paddingTop-wk8lta rn-paddingRight-9aemit rn-paddingBottom-1mdbw0j rn-paddingLeft-gy4na3 rn-textDecoration-bauka4 rn-textShadow-14hblb1 rn-whiteSpace-q42fyq rn-wordWrap-qvutc0"

那里有 的变化,但很难发现。每当我做出微小的样式更改时,我的测试就会充满了几十个这样的差异。这会产生很多噪音,并降低了测试的实用性。

我的问题是,这可以改进吗?我的快照可以在新行上写每个className吗?是否可以进行角色差异,比如GitHub?

0 个答案:

没有答案