gpt4 book ai didi

How to use flutter_test_config.dart(如何使用FIFTH_TEST_CONFAR.DART)

转载 作者:bug小助手 更新时间:2023-10-24 19:38:55 24 4
gpt4 key购买 nike



I'm trying to figure out how to use a flutter_test_config.dart file to configure a group of tests. Here is the code that I have in the file.

我正在尝试弄清楚如何使用fltter_test_config.dart文件来配置一组测试。这是我在文件中拥有的代码。



import 'dart:async';

import 'package:sqflite/sqflite.dart';
import 'package:mockito/mockito.dart';

class MockDatabase extends Mock implements Database {}

Future<void> main(FutureOr<void> testMain()) {
final Database db = MockDatabase();
testMain();
}


I would like to provide the db to the tests in this directory. What is the correct way to do this?

我想为这个目录中的测试提供数据库。这样做的正确方法是什么?


更多回答

Did you ever get an answer on this one?

你在这件事上得到过答案吗?

Not yet, my workaround is to duplicate the code where necessary.

还没有,我的解决办法是在必要的地方复制代码。

优秀答案推荐
更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com