OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

Test fails in web package

Open fcnjd opened this issue 8 months ago • 5 comments

Hi, I thought about running the web frontend myself, and read the contribution guide. However, there are test failures in the web package. I'm using, as suggested, node LTS version. Here's the output of the test, as well as the exact version:

julian@v2202412244818302705:~/src/OpenJSCAD.org/packages/web$ npm test

> @jscad/[email protected] test
> ava 'src/**/*.test.js' --verbose --timeout 2m


  Uncaught exception in src/most-gestures/gestures.test.js

  Error: Cannot find module 'most'
  Require stack:
  - /home/julian/src/OpenJSCAD.org/packages/web/src/most-gestures/index.js
  - /home/julian/src/OpenJSCAD.org/packages/web/src/most-gestures/gestures.test.js
  - /home/julian/src/OpenJSCAD.org/node_modules/ava/lib/worker/subprocess.js

  › - /home/julian/src/OpenJSCAD.org/node_modules/ava/lib/worker/subprocess.js
  › Object.<anonymous> (src/most-gestures/index.js:1:30)

  ✖ src/most-gestures/gestures.test.js exited with a non-zero exit code: 1
  ─

  1 uncaught exception
julian@v2202412244818302705:~/src/OpenJSCAD.org/packages/web$ node --version
v22.14.0

Thanks in advance for any advice what I might be doing wrong here.

fcnjd avatar Apr 07 '25 13:04 fcnjd

Hi

Be sure to run 'npm install' from the OpenJSCAD.org directory. This will install 'Lerna'.

Then run 'npm test' from the OpenJSCAD.org directly. This will install and link all packages. And run the test suites.

Does that work?

z3dev avatar Apr 07 '25 21:04 z3dev

Hi @z3dev , thank you for your quick reply and sorry for being inaccurate. That's how I did it: run npm install and then npm test in the project root, and those errors came in the web subfolder. I just didn't share the whole output so that the command doesn't get too long. The errors were the same as when just running npm test in the web folder.

fcnjd avatar Apr 08 '25 07:04 fcnjd

no problem

Can you tell us the OS version? And version of NPM and NODJES?

z3dev avatar Apr 08 '25 09:04 z3dev

Sure. I'm using Debian 12.9, Node v22.14.0, and npm 10.9.2. It was installed and activated with nvm install --lts and nvm use --lts. I really did nothing more than a Git clone, and then in the OpenJSCAD.org directory npm install and npm test.

fcnjd avatar Apr 08 '25 09:04 fcnjd

@fcnjd Sorry the late reply. I just tried a fresh install. I did not have any issues running the tests.

All the projects are managed as a mon-repo, meaning each is setup and linked together. You have to start by running...

git clone https://github.com/jscad/OpenJSCAD.org.git
cd OpenJSCAD.org
npm install
npm run bootstrap
npm run test

z3dev avatar Apr 20 '25 01:04 z3dev