elm-explorations / elm-explorations/test

Read file from tests

Open
#121 11 comments 6 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
244
Forks
40
Avg merge
1d 23h
Merged PRs (30d)
2

Description

Hello!

It would be really awesome if we were able to read files from our elm tests! As an example, consider canned JSON responses from an API. It would be great to keep these as separate `.json` files instead of bringing them into my elm source files as multi-line strings.

See this related Stack Overflow post: https://stackoverflow.com/questions/48378601/load-external-data-into-elm-test-suite

The solution in the post proposed using Native Modules. Unfortunately, because native modules have been (mostly) deprecated as of 0.19, it seems that the only way to reasonably use this approach to read files would be through `elm-explorations/test`. I think this a really reasonable use case for testing and would like to propose it as a feature request. I'm happy to help propose what an API might look like and implement a prototype if there is support from the admins.

Thanks,
Advait

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.