简体   繁体   中英

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. 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.

If u using VScode Follow this steps 1.Step 1 area click anf then 2.Step 2 area Whatever device you want to choose

[ 脚步 ][]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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