mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge branch 'bg-add-missing-unit-test' into bg-fix-use-output-dir
This commit is contained in:
commit
8946f87ca6
1 changed files with 26 additions and 0 deletions
|
@ -122,6 +122,32 @@ describe('ResourceStateManager', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('when the state file is not present', function () {
|
||||
beforeEach(function () {
|
||||
this.SafeReader.readFile = sinon.stub().callsArg(3)
|
||||
return this.ResourceStateManager.checkProjectStateMatches(
|
||||
this.state,
|
||||
this.basePath,
|
||||
this.callback
|
||||
)
|
||||
})
|
||||
|
||||
it('should read the resource file', function () {
|
||||
return this.SafeReader.readFile
|
||||
.calledWith(this.resourceFileName)
|
||||
.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')
|
||||
})
|
||||
})
|
||||
|
||||
return describe('when the state does not match', function () {
|
||||
beforeEach(function () {
|
||||
this.SafeReader.readFile = sinon
|
||||
|
|
Loading…
Reference in a new issue