Skip to content

Running test 'Check if item list is rendered' fails when following README guide #100

@Hako-Ben

Description

@Hako-Ben

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions