Testing update for Browser.application (Nav.Key gets in the way)

I recently noticed how easy it would be to test my app’s logic, since I just need to call the update with a Msg and Model and can check the output. At least I thought, until I noticed that because I use Browser.application, my Model contains a Nav.Key, which I cannot generate.

Before I go through the trouble of extracting a SubModel that only includes my app’s model without the Key, I wanted to ask whether I missed some way of testing the update function for Browser.application more easily? Do you know any tricks here?

There is an issue for this in elm-test. https://github.com/elm-explorations/test/issues/24
Some ideas there in the comments that might be helpful.

2 Likes

Thanks, I should have looked there! :sweat_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.