Unit tests on Node.js don't run locally (on Windows?)
See original GitHub issueDescribe 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:
$ npm install
$ npm install --prefix test
$ 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Test nodejs server code without running server - Stack Overflow
I have a nodejs server that runs some complex server side logic, and I'm looking at building a unit test runner for that...
Read more >Unit testing JavaScript and TypeScript - Visual Studio (Windows)
Visual Studio provides support unit testing JavaScript and TypeScript code using the Node.js Tools for Visual Studio.
Read more >Unit testing in Node.js - ticehurst.com
You can run the tests by clicking the Run All link in the Test Explorer window. Or, you can run tests by selecting...
Read more >Node.js Unit Testing: Get Started Quickly With Examples
This post we'll show you how to get started with Node.js unit testing in practice, with examples. Think of this post as a...
Read more >Testing Node.js | WebStorm Documentation - JetBrains
With WebStorm, you can test Node.js applications using numerous frameworks. ... npm install mocha for local installation in your project.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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…