简体   繁体   English

如何在浏览器中运行 flutter 单元测试?

[英]How can I run flutter unit test in the browser?

The command flutter test -p chrome /path/to/my/test/file.dart unable to work.命令flutter test -p chrome /path/to/my/test/file.dart无法工作。 What parameters should I use?我应该使用哪些参数?

[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.17763.1817], locale zh-CN)
    • Flutter version 2.0.3 at D:\SDK\Flutter
    • Framework revision 4d7946a68d (13 days ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

Being a unit test you should not specify any platform.作为单元测试,您不应指定任何平台。 So the command should only be flutter test /path/to/my/test/file.dart You only need to run on a specific platform in cases of integration tests.所以命令应该只有flutter test /path/to/my/test/file.dart在集成测试的情况下只需要在特定平台上运行即可。

If u using VScode Follow this steps 1.Step 1 area click anf then 2.Step 2 area Whatever device you want to choose如果您使用 VScode 请按照以下步骤操作 1.Step 1 区域单击 anf 然后 2.Step 2 区域您要选择的任何设备

[ [脚步 ][] ][]

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

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