$ jest --forceExit --runInBand --coverage && yarn lint && yarn spell
FAIL test/server.test.js (15.788s)
● destroys everything on exit
Fall with:
INFO Logux server is listening at 1970-01-01 00:00:00
PID: 21384
Logux server: 0.0.0
Environment: test
Node ID: server:FnXaqDxY
Subprotocol: 1.0.0
Supports: 1.x
Health check: http://127.0.0.1:31338/status
Listen: ws://127.0.0.1:2000/
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
● uses environment variables for config
Fall with:
{"name":"logux-server","hostname":"localhost","pid":21384,"level":30,"loguxServer":"0.0.0","environment":"test","nodeId":"server:FnXaqDxY","subprotocol":"1.0.0","supports":"1.x","listen":"ws://127.0.0.1:31337/","healthCheck":"http://127.0.0.1:31338/status","msg":"Logux server is listening","time":"1970-01-01T00:00:00.000Z","v":0}
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
● uses reporter param
Fall with:
{"name":"logux-server","hostname":"localhost","pid":21384,"level":30,"loguxServer":"0.0.0","environment":"test","nodeId":"server:FnXaqDxY","subprotocol":"1.0.0","supports":"1.x","listen":"ws://127.0.0.1:31337/","healthCheck":"http://127.0.0.1:31338/status","msg":"Logux server is listening","time":"1970-01-01T00:00:00.000Z","v":0}
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
● shows help about privileged port
Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
196 | })
197 |
> 198 | it('shows help about privileged port', () => checkError('eacces.js'))
| ^
199 |
200 | it('shows help about unknown option', () => checkError('unknown.js'))
201 |
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Object.it (test/server.test.js:198:1)
● writes to bunyan log
Fall with:
{"name":"logux-server","hostname":"localhost","pid":21384,"level":50,"err":{"message":"listen EADDRINUSE: address already in use 127.0.0.1:31338","name":"Error"},"note":"Another Logux server or other app already running on this port. Maybe you didn’t not stop server from other project or previous version of this server was not killed.","msg":"Port `31338` already in use","time":"1970-01-01T00:00:00.000Z","v":0}
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
● writes to custom bunyan log
Fall with:
{"name":"logux-server-custom","customProp":"42","hostname":"localhost","pid":21384,"level":50,"err":{"message":"listen EADDRINUSE: address already in use 127.0.0.1:31338","name":"Error"},"note":"Another Logux server or other app already running on this port. Maybe you didn’t not stop server from other project or previous version of this server was not killed.","msg":"Port `31338` already in use","time":"1970-01-01T00:00:00.000Z","v":0}
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
● writes using custom reporter
Fall with:
Event: error
Details: {"err":{"code":"EADDRINUSE","errno":"EADDRINUSE","syscall":"listen","address":"127.0.0.1","port":31338}}
62 | let exit = result[1]
63 | if (exit !== 0) {
> 64 | throw new Error(`Fall with:\n${ out }`)
| ^
65 | }
66 | expect(out).toMatchSnapshot()
67 | })
at check.then.result (test/server.test.js:64:13)
FAIL test/bind-backend-proxy.test.js
● reports about network errors
expect(received).toEqual(expected)
Difference:
- Expected
+ Received
- Array [
- "ECONNREFUSED",
- ]
+ Array []
256 | return delay(100)
257 | }).then(() => {
> 258 | expect(errors).toEqual(['ECONNREFUSED'])
| ^
259 | expect(app.log.actions()).toEqual([
260 | { type: 'logux/undo', reason: 'error', id: '1 10:uuid 0' }
261 | ])
at toEqual (test/bind-backend-proxy.test.js:258:20)
● reacts on wrong backend answer
expect(received).toEqual(expected)
Difference:
- Expected
+ Received
@@ -15,16 +15,16 @@
"id": "1 10:uuid 0",
"reason": "error",
"type": "logux/undo",
},
Object {
- "id": "2 10:uuid 0",
+ "id": "3 10:uuid 0",
"reason": "error",
"type": "logux/undo",
},
Object {
- "id": "3 10:uuid 0",
+ "id": "2 10:uuid 0",
"reason": "error",
"type": "logux/undo",
},
Object {
"id": "4 10:uuid 0",
440 | return delay(100)
441 | }).then(() => {
> 442 | expect(app.log.actions()).toEqual([
| ^
443 | { type: 'BROKEN1' },
444 | { type: 'BROKEN2' },
445 | { type: 'BROKEN3' },
at toEqual (test/bind-backend-proxy.test.js:442:31)
FAIL test/base-server.test.js
● uses HTTPS
listen EADDRINUSE: address already in use 127.0.0.1:31338
● uses HTTPS
listen EADDRINUSE: address already in use 127.0.0.1:31338
● loads keys by absolute path
listen EADDRINUSE: address already in use 127.0.0.1:31337
● loads keys by absolute path
listen EADDRINUSE: address already in use 127.0.0.1:31337
● loads keys by relative path
listen EADDRINUSE: address already in use 127.0.0.1:31337
● loads keys by relative path
listen EADDRINUSE: address already in use 127.0.0.1:31337
● supports object in SSL key
listen EADDRINUSE: address already in use 127.0.0.1:31337
● supports object in SSL key
listen EADDRINUSE: address already in use 127.0.0.1:31337
● reporters on start listening
listen EADDRINUSE: address already in use 127.0.0.1:31337
● reporters on start listening
listen EADDRINUSE: address already in use 127.0.0.1:31337
● creates a client on connection
listen EADDRINUSE: address already in use 127.0.0.1:31337
● creates a client on connection
listen EADDRINUSE: address already in use 127.0.0.1:31337
● accepts custom HTTP server
listen EADDRINUSE: address already in use 127.0.0.1:31338
● accepts custom HTTP server
listen EADDRINUSE: address already in use 127.0.0.1:31338
● marks actions with own node ID
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● marks actions with waiting status
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● defines actions types
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● does not allow to define type twice
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● requires access callback for type
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about unknown action type
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● ignores unknown type for processed actions
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about fatal error
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● sends errors to clients in development
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● does not send errors in non-development mode
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● processes actions
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● has full events API
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● waits for last processing before destroy
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about error during action processing
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● undos actions on client
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● adds current subprotocol to meta
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● adds current subprotocol only to own actions
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● allows to override subprotocol in meta
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● checks channel definition
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about wrong channel name
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● checks custom channel name subscriber
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● allows to have custom channel name check
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● ignores subscription for other servers
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● checks channel access
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about errors during channel authorization
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● subscribes clients
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● cancels subscriptions on disconnect
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about errors during channel initialization
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● loads initial actions during subscription
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● does not need type definition for own actions
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● checks callbacks in unknown type handler
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
● reports about useless actions
Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
FAIL test/create-reporter.test.js
● creates human reporter
expect(received).toEqual(expected)
Difference:
- Expected
+ Received
- /dir/
+ /dir/\
85 | let stream = reporter.logger.streams[0].stream
86 | expect(stream instanceof HumanFormatter).toBeTruthy()
> 87 | expect(stream.basepath).toEqual('/dir/')
| ^
88 | expect(stream.chalk.enabled).toBeFalsy()
89 | })
90 |
at Object.toEqual (test/create-reporter.test.js:87:27)
● adds trailing slash to path
expect(received).toEqual(expected)
Difference:
- Expected
+ Received
- /dir/
+ /dir\
91 | it('adds trailing slash to path', () => {
92 | let reporter = createReporter({ reporter: 'human', root: '/dir' })
> 93 | expect(reporter.logger.streams[0].stream.basepath).toEqual('/dir/')
| ^
94 | })
95 |
96 | it('uses color in development', () => {
at Object.toEqual (test/create-reporter.test.js:93:54)
● reports error
expect(received).toMatchSnapshot()
Snapshot name: `reports error 2`
- Snapshot
+ Received
" FATAL Some mistake at 1970-01-01 00:00:00
- at Object.<anonymous> (./index.js:28:13)
+ at Object.<anonymous> (/dev/app/index.js:28:13)
at Module._compile (module.js:573:32)
- at at runTest (./node_modules/jest/index.js:50:10)
+ at at runTest (/dev/app/node_modules/jest/index.js:50:10)
at process._tickCallback (internal/process/next_tick.js:103:7)
"
48 |
49 | humanReporter(type, details)
> 50 | expect(clean(human.string)).toMatchSnapshot()
| ^
51 | }
52 |
53 | function createError (name, message) {
at toMatchSnapshot (test/create-reporter.test.js:50:31)
at Object.check (test/create-reporter.test.js:316:3)
● reports error from action
expect(received).toMatchSnapshot()
Snapshot name: `reports error from action 2`
- Snapshot
+ Received
" ERROR Some mistake at 1970-01-01 00:00:00
- at Object.<anonymous> (./index.js:28:13)
+ at Object.<anonymous> (/dev/app/index.js:28:13)
at Module._compile (module.js:573:32)
- at at runTest (./node_modules/jest/index.js:50:10)
+ at at runTest (/dev/app/node_modules/jest/index.js:50:10)
at process._tickCallback (internal/process/next_tick.js:103:7)
Action ID: 1487805099387 100:uImkcF4z 0
"
48 |
49 | humanReporter(type, details)
> 50 | expect(clean(human.string)).toMatchSnapshot()
| ^
51 | }
52 |
53 | function createError (name, message) {
at toMatchSnapshot (test/create-reporter.test.js:50:31)
at Object.check (test/create-reporter.test.js:320:3)
› 2 snapshots failed.
PASS test/server-client.test.js
PASS test/start-control-server.test.js
PASS test/index.test.js
PASS test/filtered-node.test.js
PASS test/context.test.js
PASS test/force-promise.test.js
PASS test/parse-node-id.test.js
PASS test/promisify.test.js
-------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
-------------------------|----------|----------|----------|----------|-------------------|
All files | 99.27 | 97.19 | 99.47 | 99.23 | |
allowed-meta.js | 100 | 100 | 100 | 100 | |
base-server.js | 99.48 | 97.08 | 98.63 | 99.45 | 415,422 |
bind-backend-proxy.js | 100 | 98.18 | 100 | 100 | 132 |
context.js | 100 | 100 | 100 | 100 | |
create-reporter.js | 100 | 97.73 | 100 | 100 | 93 |
filtered-node.js | 100 | 90.91 | 100 | 100 | 28 |
force-promise.js | 100 | 100 | 100 | 100 | |
human-formatter.js | 96.03 | 92.75 | 100 | 95.73 |... 56,157,158,160 |
index.js | 100 | 100 | 100 | 100 | |
parse-node-id.js | 100 | 100 | 100 | 100 | |
promisify.js | 100 | 100 | 100 | 100 | |
server-client.js | 100 | 100 | 100 | 100 | |
start-control-server.js | 100 | 100 | 100 | 100 | |
-------------------------|----------|----------|----------|----------|-------------------|
Jest: "global" coverage threshold for statements (100%) not met: 99.27%
Snapshot Summary
› 2 snapshots failed from 1 test suite. Inspect your code changes or run `yarn test -u` to update them.
Test Suites: 4 failed, 8 passed, 12 total
Tests: 52 failed, 159 passed, 211 total
Snapshots: 2 failed, 70 passed, 72 total
Time: 29.616s, estimated 30s
Ran all test suites.
Force exiting Jest
Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Process finished with exit code 1