Merge pull request #169 from overleaf/bg-record-latexmk-output

record latexmk output
This commit is contained in:
Brian Gough
2020-06-02 09:03:43 +01:00
committed by GitHub
4 changed files with 71 additions and 5 deletions

View File

@@ -37,7 +37,10 @@ describe('LatexRunner', function() {
done() {}
})
},
'./CommandRunner': (this.CommandRunner = {})
'./CommandRunner': (this.CommandRunner = {}),
'fs': (this.fs = {
writeFile: sinon.stub().callsArg(2)
})
}
})
@@ -83,6 +86,21 @@ describe('LatexRunner', function() {
)
.should.equal(true)
})
it('should record the stdout and stderr', function () {
this.fs.writeFile
.calledWith(
this.directory + '/' + 'output.stdout',
"this is stdout"
)
.should.equal(true)
this.fs.writeFile
.calledWith(
this.directory + '/' + 'output.stderr',
"this is stderr"
)
.should.equal(true)
})
})
describe('with an .Rtex main file', function() {

View File

@@ -230,6 +230,12 @@ describe('ResourceWriter', function() {
{
path: '_markdown_main/30893013dec5d869a415610079774c2f.md.tex',
type: 'tex'
},
{
path: 'output.stdout'
},
{
path: 'output.stderr'
}
]
this.resources = 'mock-resources'
@@ -256,7 +262,19 @@ describe('ResourceWriter', function() {
.should.equal(true)
})
it('should delete the extra files', function() {
it('should delete the stdout log file', function () {
return this.ResourceWriter._deleteFileIfNotDirectory
.calledWith(path.join(this.basePath, 'output.stdout'))
.should.equal(true)
})
it('should delete the stderr log file', function () {
return this.ResourceWriter._deleteFileIfNotDirectory
.calledWith(path.join(this.basePath, 'output.stderr'))
.should.equal(true)
})
it('should delete the extra files', function () {
return this.ResourceWriter._deleteFileIfNotDirectory
.calledWith(path.join(this.basePath, 'extra/file.tex'))
.should.equal(true)