Closed dshenderson closed 3 years ago
It's been 3 weeks since I posted this issue. Anyone have any thoughts? I'm trying to avoid relative path hell, but if this isn't resolved I will either have to use relative paths or use a different testing framework, neither of which is ideal. Thanks in advance for any help!
How are you invoking RITEWay? What does your test script look like? RITEWay doesn't do anything special with respect to module import resolution. You can literally invoke it like node my/test/folder/file.js
and it will act just like any other JS script you run.
Does your test script even use your Webpack config? That might be your issue.
Thank you, and apologies.
Apologies because you're right, the issue wasn't with RITEWay.
And thank you, because your comment nudged me out of my mental rut.
The tests do not use the Webpack config, but I wasn't seeing that. I've resolved the problem by using babel-plugin-module-resolver
.
Closing the ticket. Thanks!
I have the following in my Webpack config:
However, when I run tests, it doesn't seem to recognise paths pointing to directories in
src
.For example, if I have
I get the following error:
To get it to work, I seem to have to use a relative path:
Absolute paths in imported modules are also not properly resolved.