Hey friends!
I'm migrating to the JS IR compiler and had a question:
We previously had some "js interface tests" in our
jsTest
sourceset which would basically do something ugly like:
js("""
var assert = require('assert');
var moduleUnderTest = require('myGroup-myModule');
assert(moduleUnderTest.method("parameter") == expectedResponse);
""")
While a little janky, this kind of test let us verify that things like JsName were added where expected and that we didn't accidentally break the public API for our JS consumers.
Now, under JS IR, the
require
for my module is failing, because there's no JS file in the expected path. There
is a package.json though.
Does anyone know how to get the module import working again under IR?
I'd also be happy to replace this with a JS file (instead of using
js()
) that actually uses the final JS artifacts if anyone has an example of a project that does that!
EDIT: it looks like I can remove the
require(…)
and get some stuff working, but not everything...