关于快照测试 #45
vincentCheng
started this conversation in
Ideas
关于快照测试
#45
Replies: 1 comment
-
一般都是在运行中,根据提示按 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
up主牛逼!
快照测试那一章里面,如果在Title中加入了Row和Col,运行npm run test会报错,卡在expect(baseElement).toMatchSnapshot();这一句。
这时候就算是我更新snap,“npx jest -U”,也会爆出同样的错误。
我的解决方案:
1、在package.json中添加 "test":"jest --watch";
2、运行 "npm run jest";
3、输入字母 "u";
这样才能正确更新快照;
Beta Was this translation helpful? Give feedback.
All reactions