Merge branch 'update'
This commit is contained in:
commit
986a2e15cf
@ -1,6 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8.1.2"
|
||||
- "8.12.0"
|
||||
script: npm run ci
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import EventEmitter from 'events'
|
||||
const Peer = jest.genMockFunction().mockImplementation(() => {
|
||||
const Peer = jest.fn().mockImplementation(() => {
|
||||
let peer = new EventEmitter()
|
||||
peer.destroy = jest.fn()
|
||||
peer.signal = jest.fn()
|
||||
|
||||
10694
package-lock.json
generated
10694
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
88
package.json
88
package.json
@ -35,53 +35,53 @@
|
||||
"author": "Jerko Steiner",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bluebird": "3.3.4",
|
||||
"classnames": "2.2.5",
|
||||
"config": "1.26.1",
|
||||
"express": "4.13.3",
|
||||
"prop-types": "15.5.10",
|
||||
"pug": "2.0.0-rc.2",
|
||||
"react": "15.5.4",
|
||||
"react-dom": "15.5.4",
|
||||
"react-redux": "5.0.5",
|
||||
"react-transition-group": "1.1.3",
|
||||
"redux": "3.6.0",
|
||||
"redux-logger": "3.0.6",
|
||||
"redux-promise-middleware": "4.2.0",
|
||||
"redux-thunk": "2.2.0",
|
||||
"seamless-immutable": "7.1.2",
|
||||
"simple-peer": "8.1.0",
|
||||
"socket.io": "1.6.0",
|
||||
"socket.io-client": "1.6.0",
|
||||
"underscore": "1.8.3",
|
||||
"uuid": "2.0.1"
|
||||
"bluebird": "^3.3.4",
|
||||
"classnames": "^2.2.5",
|
||||
"config": "^1.26.1",
|
||||
"express": "^4.13.3",
|
||||
"prop-types": "^15.5.10",
|
||||
"pug": "^2.0.0-rc.2",
|
||||
"react": "^15.5.4",
|
||||
"react-dom": "^15.5.4",
|
||||
"react-redux": "^5.0.5",
|
||||
"react-transition-group": "^1.1.3",
|
||||
"redux": "^3.6.0",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-promise-middleware": "^4.2.0",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"seamless-immutable": "^7.1.2",
|
||||
"simple-peer": "^8.1.0",
|
||||
"socket.io": "^2.1.1",
|
||||
"socket.io-client": "^2.1.1",
|
||||
"underscore": "^1.8.3",
|
||||
"uuid": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "7.2.3",
|
||||
"babel-jest": "20.0.3",
|
||||
"babel-plugin-transform-class-properties": "6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "6.23.0",
|
||||
"babel-preset-es2015": "6.24.1",
|
||||
"babel-preset-es2016": "6.24.1",
|
||||
"babel-preset-react": "6.24.1",
|
||||
"babelify": "7.3.0",
|
||||
"chastifol": "4.1.0",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "10.2.1",
|
||||
"eslint-config-standard-react": "5.0.0",
|
||||
"eslint-plugin-import": "2.3.0",
|
||||
"eslint-plugin-node": "5.0.0",
|
||||
"eslint-plugin-promise": "3.5.0",
|
||||
"eslint-plugin-react": "7.0.1",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"jest-cli": "20.0.4",
|
||||
"node-sass": "4.5.3",
|
||||
"nodemon": "1.11.0",
|
||||
"react-addons-test-utils": "15.5.1",
|
||||
"redux-mock-store": "1.2.3",
|
||||
"babel-eslint": "^7.2.3",
|
||||
"babel-jest": "^20.0.3",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.23.0",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-preset-es2016": "^6.24.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babelify": "^7.3.0",
|
||||
"chastifol": "^4.1.0",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-config-standard-react": "^5.0.0",
|
||||
"eslint-plugin-import": "^2.3.0",
|
||||
"eslint-plugin-node": "^5.0.0",
|
||||
"eslint-plugin-promise": "^3.5.0",
|
||||
"eslint-plugin-react": "^7.0.1",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"jest-cli": "^23.6.0",
|
||||
"node-sass": "^4.5.3",
|
||||
"nodemon": "^1.11.0",
|
||||
"react-addons-test-utils": "^15.5.1",
|
||||
"redux-mock-store": "^1.2.3",
|
||||
"supertest": "^3.0.0",
|
||||
"uglify-js": "2.6.2",
|
||||
"watchify": "3.9.0"
|
||||
"uglify-js": "^2.6.2",
|
||||
"watchify": "^3.9.0"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
||||
@ -22,6 +22,7 @@ describe('App', () => {
|
||||
beforeEach(() => {
|
||||
init.mockReturnValue(initAction)
|
||||
state = reducers()
|
||||
window.HTMLMediaElement.prototype.play = jest.fn()
|
||||
})
|
||||
|
||||
let component, node, store
|
||||
|
||||
11
src/client/__tests__/middlewares-test.js
Normal file
11
src/client/__tests__/middlewares-test.js
Normal file
@ -0,0 +1,11 @@
|
||||
import logger from 'redux-logger'
|
||||
import { create } from '../middlewares.js'
|
||||
|
||||
describe('store', () => {
|
||||
|
||||
it('should load logger middleware', () => {
|
||||
expect(create(true)).toContain(logger)
|
||||
expect(create(false)).not.toContain(logger)
|
||||
})
|
||||
|
||||
})
|
||||
@ -1,11 +0,0 @@
|
||||
window.localStorage = { log: true }
|
||||
import logger from 'redux-logger'
|
||||
const store = require('../store.js')
|
||||
|
||||
describe('store', () => {
|
||||
|
||||
it('should load logger middleware', () => {
|
||||
expect(store.middlewares.some(m => m === logger)).toBeTruthy()
|
||||
})
|
||||
|
||||
})
|
||||
@ -27,7 +27,7 @@ describe('reducers/alerts', () => {
|
||||
|
||||
describe('init', () => {
|
||||
|
||||
it('calls handshake.init when connected & got camera stream', done => {
|
||||
it('calls handshake.init when connected & got camera stream', async () => {
|
||||
const promise = store.dispatch(CallActions.init())
|
||||
socket.emit('connect')
|
||||
expect(store.getActions()).toEqual([{
|
||||
@ -40,18 +40,16 @@ describe('reducers/alerts', () => {
|
||||
type: 'warning'
|
||||
}
|
||||
}])
|
||||
promise.then(() => {
|
||||
expect(SocketActions.handshake.mock.calls).toEqual([[{
|
||||
socket,
|
||||
roomName: callId,
|
||||
stream: getUserMedia.stream
|
||||
}]])
|
||||
})
|
||||
.then(done)
|
||||
.catch(done.fail)
|
||||
await promise
|
||||
expect(SocketActions.handshake.mock.calls).toEqual([[{
|
||||
socket,
|
||||
roomName: callId,
|
||||
stream: getUserMedia.stream
|
||||
}]])
|
||||
})
|
||||
|
||||
it('calls dispatches disconnect message on disconnect', done => {
|
||||
it('calls dispatches disconnect message on disconnect', async () => {
|
||||
|
||||
const promise = store.dispatch(CallActions.init())
|
||||
socket.emit('connect')
|
||||
socket.emit('disconnect')
|
||||
@ -72,19 +70,15 @@ describe('reducers/alerts', () => {
|
||||
type: 'error'
|
||||
}
|
||||
}])
|
||||
promise.then(done).catch(done.fail)
|
||||
await promise
|
||||
})
|
||||
|
||||
it('dispatches alert when failed to get media stream', done => {
|
||||
it('dispatches alert when failed to get media stream', async () => {
|
||||
getUserMedia.fail(true)
|
||||
const promise = store.dispatch(CallActions.init())
|
||||
socket.emit('connect')
|
||||
promise
|
||||
.then(result => {
|
||||
expect(result.value).toBe(null)
|
||||
done()
|
||||
})
|
||||
.catch(done.fail)
|
||||
const result = await promise
|
||||
expect(result.value).toBe(null)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@ -54,7 +54,7 @@ describe('components/Video', () => {
|
||||
component.setState({
|
||||
stream: { url: 'test', mediaStream }
|
||||
})
|
||||
expect(video.refs.video.src).toBe('test')
|
||||
expect(video.refs.video.src).toBe('http://localhost/test')
|
||||
component.setState({
|
||||
stream: { url: 'test', mediaStream }
|
||||
})
|
||||
|
||||
@ -8,14 +8,14 @@ describe('server/socket', () => {
|
||||
beforeEach(() => {
|
||||
socket = new EventEmitter()
|
||||
socket.id = 'socket0'
|
||||
socket.join = jest.genMockFunction()
|
||||
socket.leave = jest.genMockFunction()
|
||||
socket.join = jest.fn()
|
||||
socket.leave = jest.fn()
|
||||
rooms = {}
|
||||
|
||||
io = {}
|
||||
io.in = io.to = jest.genMockFunction().mockImplementation(room => {
|
||||
io.in = io.to = jest.fn().mockImplementation(room => {
|
||||
return (rooms[room] = rooms[room] || {
|
||||
emit: jest.genMockFunction()
|
||||
emit: jest.fn()
|
||||
})
|
||||
})
|
||||
|
||||
@ -39,8 +39,8 @@ describe('server/socket', () => {
|
||||
}
|
||||
}
|
||||
|
||||
socket.leave = jest.genMockFunction()
|
||||
socket.join = jest.genMockFunction()
|
||||
socket.leave = jest.fn()
|
||||
socket.join = jest.fn()
|
||||
})
|
||||
|
||||
it('should be a function', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user