Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

How should we use this package in unit tests? #82

Closed
sebastianbuechler opened this issue Dec 29, 2021 · 1 comment
Closed

How should we use this package in unit tests? #82

sebastianbuechler opened this issue Dec 29, 2021 · 1 comment

Comments

@sebastianbuechler
Copy link

I wanted to test my method where I use this plugin's getVersionStatus method. However, it will always throw the debugPrint message since the unit tests run on a desktop:

  Future<VersionStatus?> getVersionStatus() async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    if (Platform.isIOS) {
      return _getiOSStoreVersion(packageInfo);
    } else if (Platform.isAndroid) {
      return _getAndroidStoreVersion(packageInfo);
    } else {
      debugPrint(
          'The target platform "${Platform.operatingSystem}" is not yet supported by this package.');
    }
  }

Do you already have a solution for that?

If not: Could there be an adjustment so that we can set optional the wanted platform on the creation of a new NewVersion and check if this is set when callinggetVersionStatus and use it instead of the "real" platform?

@timtraversy
Copy link
Owner

Thanks, something like this is implemented in #75, I just need to merge it in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants