Skip to content

Missing api or documentation for testability when using NStack #71

@jakobmygind

Description

@jakobmygind

HI guys,

My snapshot-tests especially but also unit tests rely somewhat on proper non-empty strings being used when running the tests targets. When the app code accesses the static tr/lo variable an empty Localizations object is returned, which causes my snapshots to render empty string and also unit tests which rely on a piece of state which uses strings from NStack, e.g. for interpolation, to fail, due to state not working as expected.

image

I am not sure when an empty Localizations()-object would be desirable, except if the generated object had default values corresponding to the json it was generated from.

I think we need a way to make the tr/lo variable return an object instantiated from json that we control in order for this to be fully testable. One could always wrap the tr/lo in client code to be able to return a controlled Localizations object, but it would be nicer if this was supported out of the box.

Is something like this in the works? @chriscombs @pbodsk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions