[misc] bump the dev-env to 3.3.2

This commit is contained in:
Jakob Ackermann
2020-08-10 17:01:11 +01:00
parent 1ee48d0274
commit f4561c2fe2
66 changed files with 1371 additions and 1458 deletions

View File

@@ -20,8 +20,8 @@ const modulePath = require('path').join(
const Path = require('path')
const Errors = require('../../../app/js/Errors')
describe('ResourceStateManager', function() {
beforeEach(function() {
describe('ResourceStateManager', function () {
beforeEach(function () {
this.ResourceStateManager = SandboxedModule.require(modulePath, {
singleOnly: true,
requires: {
@@ -42,13 +42,13 @@ describe('ResourceStateManager', function() {
return (this.callback = sinon.stub())
})
describe('saveProjectState', function() {
beforeEach(function() {
describe('saveProjectState', function () {
beforeEach(function () {
return (this.fs.writeFile = sinon.stub().callsArg(2))
})
describe('when the state is specified', function() {
beforeEach(function() {
describe('when the state is specified', function () {
beforeEach(function () {
return this.ResourceStateManager.saveProjectState(
this.state,
this.resources,
@@ -57,19 +57,19 @@ describe('ResourceStateManager', function() {
)
})
it('should write the resource list to disk', function() {
it('should write the resource list to disk', function () {
return this.fs.writeFile
.calledWith(this.resourceFileName, this.resourceFileContents)
.should.equal(true)
})
return it('should call the callback', function() {
return it('should call the callback', function () {
return this.callback.called.should.equal(true)
})
})
return describe('when the state is undefined', function() {
beforeEach(function() {
return describe('when the state is undefined', function () {
beforeEach(function () {
this.state = undefined
this.fs.unlink = sinon.stub().callsArg(1)
return this.ResourceStateManager.saveProjectState(
@@ -80,25 +80,25 @@ describe('ResourceStateManager', function() {
)
})
it('should unlink the resource file', function() {
it('should unlink the resource file', function () {
return this.fs.unlink
.calledWith(this.resourceFileName)
.should.equal(true)
})
it('should not write the resource list to disk', function() {
it('should not write the resource list to disk', function () {
return this.fs.writeFile.called.should.equal(false)
})
return it('should call the callback', function() {
return it('should call the callback', function () {
return this.callback.called.should.equal(true)
})
})
})
describe('checkProjectStateMatches', function() {
describe('when the state matches', function() {
beforeEach(function() {
describe('checkProjectStateMatches', function () {
describe('when the state matches', function () {
beforeEach(function () {
this.SafeReader.readFile = sinon
.stub()
.callsArgWith(3, null, this.resourceFileContents)
@@ -109,21 +109,21 @@ describe('ResourceStateManager', function() {
)
})
it('should read the resource file', function() {
it('should read the resource file', function () {
return this.SafeReader.readFile
.calledWith(this.resourceFileName)
.should.equal(true)
})
return it('should call the callback with the results', function() {
return it('should call the callback with the results', function () {
return this.callback
.calledWithMatch(null, this.resources)
.should.equal(true)
})
})
return describe('when the state does not match', function() {
beforeEach(function() {
return describe('when the state does not match', function () {
beforeEach(function () {
this.SafeReader.readFile = sinon
.stub()
.callsArgWith(3, null, this.resourceFileContents)
@@ -134,7 +134,7 @@ describe('ResourceStateManager', function() {
)
})
it('should call the callback with an error', function() {
it('should call the callback with an error', function () {
this.callback
.calledWith(sinon.match(Errors.FilesOutOfSyncError))
.should.equal(true)
@@ -145,9 +145,9 @@ describe('ResourceStateManager', function() {
})
})
return describe('checkResourceFiles', function() {
describe('when all the files are present', function() {
beforeEach(function() {
return describe('checkResourceFiles', function () {
describe('when all the files are present', function () {
beforeEach(function () {
this.allFiles = [
this.resources[0].path,
this.resources[1].path,
@@ -161,13 +161,13 @@ describe('ResourceStateManager', function() {
)
})
return it('should call the callback', function() {
return it('should call the callback', function () {
return this.callback.calledWithExactly().should.equal(true)
})
})
describe('when there is a missing file', function() {
beforeEach(function() {
describe('when there is a missing file', function () {
beforeEach(function () {
this.allFiles = [this.resources[0].path, this.resources[1].path]
this.fs.stat = sinon.stub().callsArgWith(1, new Error())
return this.ResourceStateManager.checkResourceFiles(
@@ -178,7 +178,7 @@ describe('ResourceStateManager', function() {
)
})
it('should call the callback with an error', function() {
it('should call the callback with an error', function () {
this.callback
.calledWith(sinon.match(Errors.FilesOutOfSyncError))
.should.equal(true)
@@ -190,8 +190,8 @@ describe('ResourceStateManager', function() {
})
})
return describe('when a resource contains a relative path', function() {
beforeEach(function() {
return describe('when a resource contains a relative path', function () {
beforeEach(function () {
this.resources[0].path = '../foo/bar.tex'
this.allFiles = [
this.resources[0].path,
@@ -206,7 +206,7 @@ describe('ResourceStateManager', function() {
)
})
it('should call the callback with an error', function() {
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