开玩笑快照在部署期间失败

时间:2019-11-11 15:54:07

标签: javascript jestjs enzyme snapshot

我有这样的快照测试:

  it('should render correctly', () => {
    expect(shallow(<PaperStyle/>)).toMatchSnapshot();
  });

纸张在哪里:

import Paper from '@material-ui/core/Paper'

export const PaperStyle = styled(Paper)`
  padding: 20px;
`

在本地生成快照时,我得到:

...
    "render": [Function],
   },
    "displayName": "WithStyles(ForwardRef(Paper))",
    "options": Object {
    "defaultTheme": Object {
...

但是在部署中运行'yarn test(yarn test:ci)'时,添加了defaultProps: undefined,使快照在部署期间失败:

package.json

"test": "react-scripts test --watchAll=false",
"test:ci": "react-scripts test --watchAll=false --testResultsProcessor=jest-junit",

enter image description here

0 个答案:

没有答案