You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do something similar to scalajs-bundler in https://github.com/nafg/mill-bundler. One issue I'm hitting is that it needs to generate a package.json and npm install somewhere under out/, but IIUC because it's running Node from the base directory it won't see node_modules/.
This is even worse for JsDom, because with JsEnvConfig.NodeJs I can override fastLinkJSTest to inject a bundling step, producing a script that doesn't need node_modules anymore. But IIRC JsDom will require("jsdom") outside the script.
The text was updated successfully, but these errors were encountered:
nafg
changed the title
Control of working directory for Node used for tests
Ability to run Node for tests in the directory of the script
Nov 25, 2022
I edited the title, because maybe the solution is not to have a new setting or parameter to pass in the working directory. Maybe it should automatically use the script's location as the working directory.
Although, I guess most people currently maintain a package.json by hand in the root directory and manually npm install. So I guess for them tests should run in the base directory. So maybe it does have to be a setting or parameter?
Typically in Mill, tests run in a forked process and support the setting of forkWorkingDir. Unfortunately, ScalaJSModule currently does not support this setting.
I'm trying to do something similar to scalajs-bundler in https://github.com/nafg/mill-bundler. One issue I'm hitting is that it needs to generate a package.json and
npm install
somewhere underout/
, but IIUC because it's running Node from the base directory it won't seenode_modules/
.This is even worse for
JsDom
, because withJsEnvConfig.NodeJs
I can overridefastLinkJSTest
to inject a bundling step, producing a script that doesn't neednode_modules
anymore. But IIRCJsDom
willrequire("jsdom")
outside the script.The text was updated successfully, but these errors were encountered: