I followed the README guide word for word and faced an error when implementing section 6.2 Widget testing.
VSCode debug console output:
The test description was: Check if item list is rendered
Warning: At least one test in this suite creates an HttpClient. When running a test suite that uses
TestWidgetsFlutterBinding, all HTTP requests will return status code 400, and no network request
will actually be made. Any test expecting a real network connection and status code will fail.
To test code that needs an HttpClient, provide your own HttpClient implementation to the code under
test, so that your test can consistently provide a testable response to the code under test.
✖ Check if item list is rendered
Exited (1).
Issue: was caused by this line of code futureTodosList = TodoService().getTodos();
Solution: update the README section 6.2 Widget testing to prompt the user(s) to update the line futureTodosList = TodoService().getTodos(); to futureTodosList = widget.todoService.getTodos();
I followed the README guide word for word and faced an error when implementing section 6.2 Widget testing.
VSCode debug console output: The test description was: Check if item list is rendered
Warning: At least one test in this suite creates an HttpClient. When running a test suite that uses TestWidgetsFlutterBinding, all HTTP requests will return status code 400, and no network request will actually be made. Any test expecting a real network connection and status code will fail. To test code that needs an HttpClient, provide your own HttpClient implementation to the code under test, so that your test can consistently provide a testable response to the code under test. ✖ Check if item list is rendered
Exited (1).
Issue: was caused by this line of code
futureTodosList = TodoService().getTodos();
Solution: update the README section 6.2 Widget testing to prompt the user(s) to update the line
futureTodosList = TodoService().getTodos();
tofutureTodosList = widget.todoService.getTodos();