-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
We use an asset file to configure some feature inside our app.
So during test, we tried to access to it but we keep getting this error.
The getter 'buffer' was called on null.
Receiver: null
Tried calling: buffer
dart:core Object.noSuchMethod
package:flutter/src/services/asset_bundle.dart 148:29 CachingAssetBundle._fetchString
===== asynchronous gap ===========================
package:flutter/src/services/asset_bundle.dart 142:50 CachingAssetBundle.loadString.<fn>
dart:collection _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent
package:flutter/src/services/asset_bundle.dart 142:27 CachingAssetBundle.loadString
I know that assets are not available during test, but can you at least return null if no assets ?
An other possibility would be to provide assets before test like tester.provideAsset(name, asset);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds