简体   繁体   English

模拟 flutter 集成测试

[英]Mocks in flutter integration tests

I am writing an integration test in Flutter, and there is one call that I have to mock (sending an email confirmation code - can only be mocked).我正在 Flutter 中编写集成测试,并且有一个调用我必须模拟(发送 email 确认码 - 只能被模拟)。

Is there any way to do it?有什么办法吗? All solutions I find depend on Injection, which could be ok for unit testing, but I can't really do it, cause I am testing the whole app by calling await tester.pumpWidget(App());我找到的所有解决方案都依赖于注入,这对于单元测试来说可能没问题,但我真的做不到,因为我正在通过调用await tester.pumpWidget(App());来测试整个应用程序。 . .

What could be a solution, I dont' wnt ot path my authentication service from App() down the tree.什么是解决方案,我不想将我的身份验证服务从 App() 沿着树向下路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM