Repository navigation
[flutter_tools] fix tests that depend on correct cache existance - #60241
Merged
Merged
Conversation
jonahwilliams
commented
Jun 24, 2020
|
|
||
| setUp(() { | ||
| cache = MockCache(); | ||
| when(cache.dyLdLibEntry).thenReturn(const MapEntry<String, String>('foo', 'bar')); |
Contributor
Author
There was a problem hiding this comment.
Device discovery created by instantiating DeviceDiscoverers looks up this entry from the cache, will fail if the path does not exist.
jonahwilliams
commented
Jun 24, 2020
|
|
||
| setUp(() { | ||
| cache = MockCache(); | ||
| when(cache.dyLdLibEntry).thenReturn(const MapEntry<String, String>('foo', 'bar')); |
jonahwilliams
commented
Jun 24, 2020
| trackWidgetCreation: false, | ||
| treeShakeIcons: false, | ||
| ), | ||
| generator: MockResidentCompiler(), |
Contributor
Author
There was a problem hiding this comment.
If the generator is not provided, one is created but that looks up the dartSdk path from the cache.
Contributor
There was a problem hiding this comment.
I thought it was hard to write tools tests, but turns out I had no idea...
Contributor
Author
There was a problem hiding this comment.
the nice thing is ... there are no issues with the tests using testWithoutContext, so at least we are on the right path 👍
|
Started Google testing for this PR |
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
…tter#60241) These tests will hit the real Cache, failing if the flutter root has been modified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
These tests will hit the real Cache, failing if the flutter root has been modified