Windows - Can't run test script + lots of failing mocha tests
See original GitHub issueMy environment: Node 6.9.2 Windows 10 gnatsd-v0.9.4-windows-amd64
Im trying to run the test but Im facing with many issues
- Seems that the command is not optimitzed for windows
E:\Repositorys\node-nats>npm run test
> nats@0.7.0 test E:\Repositorys\node-nats
> npm run depcheck && npm run depcheck:unused && npm run lint && npm run test:unit
> nats@0.7.0 depcheck E:\Repositorys\node-nats
> dependency-check . lib/*
Success! All dependencies used in the code are listed in package.json
> nats@0.7.0 depcheck:unused E:\Repositorys\node-nats
> dependency-check ./package.json --unused --no-dev lib/*
Success! All dependencies in package.json are used in the code
> nats@0.7.0 lint E:\Repositorys\node-nats
> jshint --reporter node_modules/jshint-stylish lib/*.js test/*.js test/support/*.js examples/*.js
ERROR: Can't open lib/*.js
ERROR: Can't open test/*.js
ERROR: Can't open test/support/*.js
ERROR: Can't open examples/*.js
β No problems
> nats@0.7.0 test:unit E:\Repositorys\node-nats
> mkdir -p reports/ && NODE_ENV=test multi='spec=- xunit=reports/mocha-xunit.xml' istanbul cover _mocha -- -R mocha-multi --timeout 10000 --slow 750 && istanbul check-coverage
The syntax of the command is incorrect.
- I skip that above and try
mocha --timeout 10000
and I have 25 failing tests.
mocha --timeout 10000
Authorization
1) should fail to connect with no credentials
β should connect with proper credentials in url (102ms)
β should connect with proper credentials as options (102ms)
β should connect with proper credentials as server url (103ms)
Token Authorization
β should fail to connect with no credentials
β should connect with proper credentials in url (102ms)
β should connect with proper credentials as options (101ms)
β should connect with proper credentials as server url (101ms)
Max responses and Auto-unsub
β should only received max responses requested
β should only received max responses requested (client support)
β should not complain when unsubscribing an auto-unsubscribed sid
β should allow proper override to a lesser value
β should allow proper override to a higher value
β should only receive N msgs in request mode with multiple helpers
β should not leak subscriptions when using max (102ms)
Basics
β should do basic subscribe and unsubscribe
β should do basic publish
β should fire a callback for subscription
β should include the correct message in the callback
β should include the correct reply in the callback
β should do request-reply
β should return a sub id for requests
β should do single partial wildcard subscriptions correctly
β should do partial wildcard subscriptions correctly
β should do full wildcard subscriptions correctly
β should pass exact subject to callback
β should do callback after publish is flushed
β should do callback after flush
β should handle an unsubscribe after close of connection
β should not receive data after unsubscribe call
β should pass sid properly to a message callback if requested
β should parse json messages
β should parse UTF8 json messages
β should validate json messages before publishing
Binary
β should allow sending and receiving binary data
Callbacks
β should properly do a publish callback after connection is closed
β should properly do a flush callback after connection is closed
Cluster
β should accept servers options
β should randomly connect to servers by default
β should connect to first valid server
β should emit error if no servers are available (2007ms)
β should not randomly connect to servers if noRandomize is set
β should not randomly connect to servers if dontRandomize is set
2) should fail after maxReconnectAttempts when servers killed
Basic Connectivity
β should perform basic connect with port
β should perform basic connect with uri
β should perform basic connect with options arg
β should emit a connect event
3) should emit error if no server available
β should emit connecting events and try repeatedly if configured and no server available
4) should still receive publish when some servers are invalid
5) should still receive publish when some servers[noRandomize] are invalid
β should add a new cluster server
Double SUBS
6) "before all" hook
Errors
β should throw errors on connect
β should throw errors on publish
β should throw errors on flush
β should pass errors on publish with callbacks
β should throw errors on subscribe
β NatsErrors have code
β NatsErrors can chain an error
JSON payloads
7) "before all" hook
Base Properties
β should have a version property
β should have the same version as package.json
β should have a connect function
β should have a createInbox function
Connection Properties
β should have a publish function
β should have a subscribe function
β should have an unsubscribe function
β should have a request function
β should have an options hash with proper fields
β should have an parsed url
β should allow options to be overridden
Queues
β should deliver a message to single member of a queue group
β should deliver a message to only one member of a queue group
β should allow queue subscribers and normal subscribers to work together
β should spread messages out equally (given random)
β should deliver only one mesage to queue subscriber regardless of wildcards
β should deliver to multiple queue groups
Reconnect functionality
β should not emit a reconnecting event if suppressed (254ms)
8) should emit a disconnect and a reconnecting event after proper delay
9) should emit multiple reconnecting events and fail after maxReconnectAttempts
10) should emit reconnecting events indefinitely if maxReconnectAttempts is set to -1
11) should succesfully reconnect to new server
12) should succesfully reconnect to new server with subscriptions
13) should succesfully reconnect to new server with queue subscriptions correctly
14) should properly resync with inbound buffer non-nil
15) should not crash when sending a publish with a callback after connection loss
16) should execute callbacks if published during reconnect
17) should not lose messages if published during reconnect
18) should emit reconnect before flush callbacks are called
Split Messages
19) "before all" hook
Subscription Events
20) "before all" hook
Timeout and max received events for subscriptions
21) "before all" hook
TLS
22) "before all" hook
23) "after all" hook
UTF8
24) "before all" hook
Yield
25) "before all" hook
73 passing (13s)
25 failing
Errors:
1) Authorization should fail to connect with no credentials :
Uncaught AssertionError: expected null to exist
at Client.<anonymous> (E:\Repositorys\node-nats\test\auth.js:31:14)
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:14)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
2) Cluster should fail after maxReconnectAttempts when servers killed:
Uncaught AssertionError: expected 1024 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\cluster.js:144:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
3) Basic Connectivity should emit error if no server available:
Uncaught AssertionError: expected 2049 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\cluster.js:144:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
4) Basic Connectivity should still receive publish when some servers are invalid:
Uncaught AssertionError: expected '' to be 'hello'
+ expected - actual
+hello
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Timeout._onTimeout (E:\Repositorys\node-nats\test\connect.js:94:22)
5) Basic Connectivity should still receive publish when some servers[noRandomize] are invalid:
Uncaught AssertionError: expected 0 to be 5
+ expected - actual
-0
+5
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Timeout._onTimeout (E:\Repositorys\node-nats\test\connect.js:76:31)
6) Double SUBS "before all" hook:
Error: Can't connect to server on port: 1922
at Timeout.<anonymous> (E:\Repositorys\node-nats\test\support\nats_server_control.js:58:14)
7) JSON payloads "before all" hook:
Uncaught AssertionError: expected 3072 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\cluster.js:144:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
8) Reconnect functionality should emit a disconnect and a reconnecting event after proper delay:
Uncaught AssertionError: expected 1 to be 4
+ expected - actual
-1
+4
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\cluster.js:149:26)
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:419:14)
at TCP._handle.close [as _onclose] (net.js:498:12)
9) Reconnect functionality should emit multiple reconnecting events and fail after maxReconnectAttempts:
Uncaught AssertionError: expected 1023 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\reconnect.js:71:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
10) Reconnect functionality should emit reconnecting events indefinitely if maxReconnectAttempts is set to -1:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:22222
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
11) Reconnect functionality should succesfully reconnect to new server:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:22223
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
12) Reconnect functionality should succesfully reconnect to new server with subscriptions:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:22223
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
13) Reconnect functionality should succesfully reconnect to new server with queue subscriptions correctly:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
14) Reconnect functionality should properly resync with inbound buffer non-nil:
Uncaught AssertionError: expected 2043 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\reconnect.js:71:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
15) Reconnect functionality should not crash when sending a publish with a callback after connection loss:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
16) Reconnect functionality should execute callbacks if published during reconnect:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
17) Reconnect functionality should not lose messages if published during reconnect:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
18) Reconnect functionality should emit reconnect before flush callbacks are called:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
19) Split Messages "before all" hook:
Uncaught NatsError: Could not connect to server: Error: connect ECONNREFUSED 127.0.0.1:1426
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
20) Subscription Events "before all" hook:
Uncaught AssertionError: expected 3071 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\reconnect.js:71:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
21) Timeout and max received events for subscriptions "before all" hook:
Uncaught AssertionError: expected 3215 to be within 20..100
at Assertion.fail (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:231:17)
at Assertion.value [as within] (E:\Repositorys\node-nats\node_modules\should\cjs\should.js:305:19)
at Client.<anonymous> (E:\Repositorys\node-nats\test\reconnect.js:71:25)
at Client.reconnect (E:\Repositorys\node-nats\lib\nats.js:1204:10)
at Timeout._onTimeout (E:\Repositorys\node-nats\lib\nats.js:1230:34)
22) TLS "before all" hook:
Uncaught NatsError: Could not connect to server: Error: read ECONNRESET
at Socket.<anonymous> (E:\Repositorys\node-nats\lib\nats.js:448:28)
at emitErrorNT (net.js:1278:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
23) TLS "after all" hook:
TypeError: Cannot read property 'kill' of undefined
at Context.<anonymous> (E:\Repositorys\node-nats\test\tls.js:40:14)
at callFn (C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:334:21)
at Hook.Runnable.run (C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:327:7)
at next (C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:299:10)
at Immediate.<anonymous> (C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:327:5)
24) Double SUBS "before all" hook:
Error: Can't connect to server on port: 1922
at Timeout.<anonymous> (E:\Repositorys\node-nats\test\support\nats_server_control.js:58:14)
25) Yield "before all" hook:
Uncaught TypeError: Cannot set property 'state' of undefined
at C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:562:20
at done (C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:291:5)
at C:\Users\dustin\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:372:7
at finish (E:\Repositorys\node-nats\test\support\nats_server_control.js:48:7)
at Socket.<anonymous> (E:\Repositorys\node-nats\test\support\nats_server_control.js:70:9)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1074:10)
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Tests are broken in Windows #1813 - mochajs/mocha - GitHub
After running tests again after rebase under cygwin make, I noticed two that were failing -- each was doing a split based on...
Read more >How to run Mocha tests on windows node.js ( Error
Best way I've been able to do it is to first install mocha in the directory as a dev dependency (i.e: npm install...
Read more >Mocha - the fun, simple, flexible JavaScript test framework
simple, flexible, fun. Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun....
Read more >Error Messages | Cypress Documentation
We found an error preparing your test file. This message means that Cypress encountered an error when compiling and/or bundling your test file....
Read more >Jest | IntelliJ IDEA Documentation - JetBrains
If a snapshot does not match the rendered application, the test fails. This indicates that either some changes in your code have caused...
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
Not yet - Iβll see what I can do for v2.
Any progress? π±