minimal RTCSpec added; sinon still not found?
This commit is contained in:
parent
5e99dea7f5
commit
07707c34b0
|
@ -6,6 +6,7 @@ module.exports = (config) ->
|
|||
frameworks: [
|
||||
'mocha'
|
||||
'commonjs'
|
||||
'chai-sinon'
|
||||
'chai-jquery'
|
||||
'chai'
|
||||
'jquery-2.1.0'
|
||||
|
@ -15,6 +16,10 @@ module.exports = (config) ->
|
|||
# Modules under test - list specific
|
||||
'./modules/**/Settings.js'
|
||||
'./modules/**/UIUtil.js'
|
||||
'./modules/**/RTC.js'
|
||||
|
||||
# Module services
|
||||
'./service/**/*.js'
|
||||
|
||||
# Spec files
|
||||
'./test/spec/**/*Spec.coffee'
|
||||
|
@ -23,8 +28,8 @@ module.exports = (config) ->
|
|||
exclude: []
|
||||
|
||||
preprocessors:
|
||||
# Modules under test
|
||||
'./modules/**/*.js': [ 'commonjs' ]
|
||||
# Modules and services under test
|
||||
'./{modules,service}/**/*.js': [ 'commonjs' ]
|
||||
|
||||
# Spec files
|
||||
'./test/spec/**/*Spec.coffee': [ 'coffee', 'commonjs' ]
|
||||
|
@ -40,7 +45,7 @@ module.exports = (config) ->
|
|||
bare: true
|
||||
sourceMap: false
|
||||
|
||||
reporters: [ 'progress' ]
|
||||
reporters: [ 'spec' ]
|
||||
port: 9876
|
||||
colors: true
|
||||
logLevel: config.LOG_INFO
|
||||
|
|
11
package.json
11
package.json
|
@ -28,21 +28,24 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^10.2.3",
|
||||
"chai": "^3.0.0",
|
||||
"chai": "^2.3.0",
|
||||
"chai-jquery": "^2.0.0",
|
||||
"coffee-script": "^1.9.3",
|
||||
"coffeelint": "^1.10.1",
|
||||
"jquery": "^2.1.4",
|
||||
"karma": "^0.12.36",
|
||||
"karma": "^0.12.35",
|
||||
"karma-chai": "^0.1.0",
|
||||
"karma-chai-jquery": "^1.0.0",
|
||||
"karma-chai-sinon": "^0.1.5",
|
||||
"karma-coffee-preprocessor": "^0.2.1",
|
||||
"karma-commonjs-plus": "^1.0.0",
|
||||
"karma-jquery": "^0.1.0",
|
||||
"karma-mocha": "^0.1.10",
|
||||
"karma-phantomjs-launcher": "^0.2.0",
|
||||
"karma-spec-reporter": "0.0.19",
|
||||
"mocha": "^2.2.5",
|
||||
"phantomjs": "^1.9.17"
|
||||
"phantomjs": "^1.9.17",
|
||||
"sinon": "^1.14.1",
|
||||
"sinon-chai": "^2.7.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
'use strict'
|
||||
|
||||
# Default required globals
|
||||
global.URL = true
|
||||
|
||||
mockAPP = (type) ->
|
||||
switch type
|
||||
when 'CLEAR'
|
||||
delete global.APP
|
||||
|
||||
else
|
||||
global.APP =
|
||||
xmpp:
|
||||
myJid: -> 'myJid'
|
||||
|
||||
describe 'RTC', ->
|
||||
|
||||
sandbox = undefined
|
||||
RTC = undefined
|
||||
mock =
|
||||
events: undefined
|
||||
|
||||
before ->
|
||||
sandbox = sinon.sandbox.create()
|
||||
|
||||
mock.events = sandbox.stub()
|
||||
# EventEmitter: ->
|
||||
# on: sandbox.stub()
|
||||
|
||||
afterEach ->
|
||||
sandbox.restore()
|
||||
|
||||
RTC = require('../../modules/RTC/RTC.js', {
|
||||
'events': mock.events
|
||||
'./RTCUtils.js': ->
|
||||
'./LocalStream.js': ->
|
||||
'./DataChannels': ->
|
||||
'./MediaStream.js': ->
|
||||
'../../service/desktopsharing/DesktopSharingEventTypes': ->
|
||||
'../../service/RTC/MediaStreamTypes': ->
|
||||
'../../service/RTC/StreamEventTypes.js': ->
|
||||
'../../service/RTC/RTCEvents.js': ->
|
||||
'../../service/xmpp/XMPPEvents': ->
|
||||
'../../service/UI/UIEvents': ->
|
||||
})
|
||||
|
||||
describe 'init', ->
|
||||
|
||||
props =
|
||||
rtcUtils: null
|
||||
devices:
|
||||
audio: true
|
||||
video: true
|
||||
localStreams: []
|
||||
remoteStreams: {}
|
||||
localAudio: null
|
||||
localVideo: null
|
||||
|
||||
afterEach ->
|
||||
mockAPP('CLEAR')
|
||||
|
||||
it 'should init', ->
|
||||
RTC.should.have.deep.property prop for prop of props
|
||||
|
||||
describe 'addStreamListener', ->
|
||||
|
||||
it 'should invoke eventEmitter.on', ->
|
||||
|
Loading…
Reference in New Issue