three.js: Unit tests on Node.js don't run locally (on Windows?)

Describe the bug

The unit tests on Node.js don’t run locally. They seem to run on CI server, so it might be a platform specific issue? (Refer to the Platform section below for my environment.)

To Reproduce

Steps to reproduce the behavior:

  1. $ npm install
  2. $ npm install --prefix test
  3. $ npm run test-unit

Error log:

$ npm run test-unit

> three@0.137.5 test-unit
> npm run unit --prefix test


> test-deps-intaller@1.0.0 unit
> qunit -r failonlyreporter -f !-webonly unit/three.source.unit.js

not ok 1 global failure
  ---
  message: "No tests matched the filter \"!-webonly\"."
  severity: failed
  actual: undefined
  expected: undefined
  stack: "Error: No tests matched the filter \"!-webonly\".\n    at done (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:2074:17)\n    at advanceTestQueue (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:1985:7)\n    at Object.advance (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:1940:7)\n    at unblockAndAdvanceQueue (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:4321:21)"
  ...
1..2
# pass 0
# skip 0
# todo 0
# fail 2

-f !-webonly may be unrelated. Even if I remove that filter, the tests still don’t run.

$ npm run test-unit

> three@0.137.5 test-unit
> npm run unit --prefix test


> test-deps-intaller@1.0.0 unit
> qunit -r failonlyreporter unit/three.source.unit.js

not ok 1 global failure
  ---
  message: "No tests were run."
  severity: failed
  actual: undefined
  expected: undefined
  stack: "Error: No tests were run.\n    at done (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:2082:17)\n    at advanceTestQueue (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:1985:7)\n    at Object.advance (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:1940:7)\n    at unblockAndAdvanceQueue (C:\Users\Takahiro\Documents\three.js\test\node_modules\qunit\qunit\qunit.js:4321:21)"
  ...
1..2
# pass 0
# skip 0
# todo 0
# fail 2

Expected behavior

The tests run locally.

Platform:

  • Device: Desktop
  • OS: Windows 10
  • Three.js version: dev
  • Node.js (node.js v16.13.2, npm 8.1.2), Git Bash

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Or has the entry in the lock file a higher priority?

Yup, since the package-lock.json was introduced all package versions are locked so it’s the same on any machine 😊

It is written in https://github.com/mrdoob/three.js/blob/dev/test/README.md. I think it should be added to CONTRIBUTING.md but not be performed automatically…

Hmmm if upgrading node to latest doesn’t solve it, this is an issue with the qunit code then: https://github.com/qunitjs/qunit/issues/1667