csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
441 stars 97 forks source link

Add tests to Redirection Example #335

Open Lyokone opened 2 years ago

Lyokone commented 2 years ago

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Add tests to Redirection Example and Mockito for creating a MockGoRouter

:arrow_heading_down: What is the current behavior?

No tests

:new: What is the new behavior (if this is a feature change)?

Test the redirection example

:boom: Does this PR introduce a breaking change?

No

:bug: Recommendations for testing

Run in example folder

flutter test --no-pub --coverage --test-randomize-ordering-seed random

To generate coverage. You can use LCOV to see the coverage of the example app. The redirection.dart is at 95.8% of Coverage with this PR.

:memo: Links to relevant issues/docs

Not sure if I should update changelog since it's only testing the examples.

:thinking: Checklist before submitting

csells commented 2 years ago

@Lyokone can you fix the style issue and resubmit? Likely dart format . will solve the problem.

Lyokone commented 2 years ago

It should be fixed now :)

csells commented 2 years ago

@chunhtai @Lyokone This PR is something to land after the PR bring go_router to flutter/packages has landed.

Lyokone commented 2 years ago

I can definitely resubmit this PR to flutter/package if needed 😊

chunhtai commented 2 years ago

@Lyokone yes please do. we are trying to bring the package into the flutter/package within this week.

chunhtai commented 2 years ago

this package has been moved to https://github.com/flutter/packages/tree/main/packages/go_router

Can you create a pull request against the flutter/packages instead?