I have an addon that defines a function in my-addon/lib/my-function.js. This function is used by another addon at build time via var myFunction = require("my-addon/lib/my-function") from the consuming addons' index.js.
This works great for the consuming addon, but I can’t figure out how to import the function into unit tests. Using require results in:
Error: Could not find module `my-addon/lib/my-function` imported from `(require)`
It looks like addon tests limit the modules available for import to the dummy app. Anyone know a way to include my function as a module in the dummy app, or a way to directly import the module from tests?
I strictly do not want to be exporting my function directly into consuming apps, so export ... from addon to app does not suffice.
Aucun commentaire:
Enregistrer un commentaire