Commit abfc4fdc authored by Aron Carroll's avatar Aron Carroll

Fix initialization of Host tests

parent cf4c8914
...@@ -2,13 +2,23 @@ assert = chai.assert ...@@ -2,13 +2,23 @@ assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
describe 'Annotator.Host', -> describe 'Annotator.Host', ->
sandbox = sinon.sandbox.create()
createHost = (options) -> createHost = (options) ->
element = document.createElement('div') element = document.createElement('div')
return new Annotator.Host(element, options) return new Annotator.Host(element, options)
# Disable Annotator's ridiculous logging. beforeEach ->
before -> sinon.stub(console, 'log') # Disable Annotator's ridiculous logging.
after -> console.log.restore() sandbox.stub(console, 'log')
fakeBridge =
onConnect: sandbox.stub()
on: sandbox.stub()
sandbox.stub(Annotator.Plugin, 'Bridge').returns(fakeBridge)
afterEach -> sandbox.restore()
describe 'options', -> describe 'options', ->
it 'enables highlighting when showHighlights option is provided', (done) -> it 'enables highlighting when showHighlights option is provided', (done) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment