Skip to content

Crashes in Snapshot tests on Android #8

@blakelee

Description

@blakelee

I've been running snapshot tests on Android and whenever I include TextRuleDefaults.phoneNumber() it crashes with an NPE since system services aren't available in snapshot tests.

Specifically it crashes here since the service is null. The workaround is to not include phone numbers. Try/catch isn't supported for compose functions so I can't do that.

(contextData as AndroidContextData).context.getSystemService(TelephonyManager::class.java).simCountryIso.let {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions