updated mocha and sinon, fixed tests
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const should = require('chai').should()
|
||||
const modulePath = require('path').join(
|
||||
__dirname,
|
||||
@@ -132,11 +133,13 @@ describe('ResourceStateManager', function() {
|
||||
)
|
||||
})
|
||||
|
||||
return it('should call the callback with an error', function() {
|
||||
const error = new Errors.FilesOutOfSyncError(
|
||||
'invalid state for incremental update'
|
||||
)
|
||||
return this.callback.calledWith(error).should.equal(true)
|
||||
it('should call the callback with an error', function() {
|
||||
this.callback
|
||||
.calledWith(sinon.match(Errors.FilesOutOfSyncError))
|
||||
.should.equal(true)
|
||||
|
||||
const message = this.callback.args[0][0].message
|
||||
expect(message).to.include('invalid state for incremental update')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -174,11 +177,15 @@ describe('ResourceStateManager', function() {
|
||||
)
|
||||
})
|
||||
|
||||
return it('should call the callback with an error', function() {
|
||||
const error = new Errors.FilesOutOfSyncError(
|
||||
it('should call the callback with an error', function() {
|
||||
this.callback
|
||||
.calledWith(sinon.match(Errors.FilesOutOfSyncError))
|
||||
.should.equal(true)
|
||||
|
||||
const message = this.callback.args[0][0].message
|
||||
expect(message).to.include(
|
||||
'resource files missing in incremental update'
|
||||
)
|
||||
return this.callback.calledWith(error).should.equal(true)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -198,10 +205,11 @@ describe('ResourceStateManager', function() {
|
||||
)
|
||||
})
|
||||
|
||||
return it('should call the callback with an error', function() {
|
||||
return this.callback
|
||||
.calledWith(new Error('relative path in resource file list'))
|
||||
.should.equal(true)
|
||||
it('should call the callback with an error', function() {
|
||||
this.callback.calledWith(sinon.match(Error)).should.equal(true)
|
||||
|
||||
const message = this.callback.args[0][0].message
|
||||
expect(message).to.include('relative path in resource file list')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user