`I have a Melange project with the following directory structure:
├── src
│ ├── dune
│ ├── App.re
├── __tests__
│ ├── dune
│ ├── App_test.re
The dune files in both the src
and __tests__
folders use a melange.emit stanza to compile the directories into javascript during the build. I want my App_test.re
file to use the App
module defined in App.re
, but in order to do so, I need to create a library stanza in the src/dune
file that includes the App module, and then declare that library in my melange.emit stanza in the __tests__/dune
file. The problem with this is that my melange.emit stanza in my src/dune
already includes App
as a module, so I’m unable to also declare a library in src/dune
that contains the App
module. How can I get my App_test.re
file to open my App
module without throwing the error “Unbound module App”?
I’ve tried to set this up following the instructions on the Github for melange-jest (the testing framework I’m using) but there’s not any documentation specifying how to fix this issue.
Joseph Murrey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.