website
                                
                                
                                
                                    website copied to clipboard
                            
                            
                            
                        Clarify test package use on 'An introduction to unit testing' page
Page URL
https://docs.flutter.dev/cookbook/testing/unit/introduction/
Page source
https://github.com/flutter/website/tree/main/src/cookbook/testing/unit/introduction.md
Describe the problem
Per this issue, we are now recommending users that running flutter test to only use the flutter_test dependency in their pubspec.yaml file. However, in this link, for unit tests, it gives the user the option to either use the test or flutter_test depedency.
Expected fix
We should only recommend to use the flutter_test dependency to ensure that we don't have any version solving issues for the flutter test command specifically.
Additional context
Because flutter_test depends on pinned versions of test_api, we can ensure that we won't have any version mismatches between the app pubspec and the flutter tool pubspec. More details can be found in the below issue:
- https://github.com/flutter/flutter/issues/91107
 
I also have a PR to ensure we check for this dependency in the app pubspec:
- https://github.com/flutter/flutter/pull/139498
 
I would like to fix this problem.
- [ ] I will try and fix this problem on docs.flutter.dev.