2020-02-19 11:16:07 +00:00
|
|
|
/* eslint-disable
|
|
|
|
no-unused-vars,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2020-02-19 11:16:00 +00:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2020-02-19 11:16:14 +00:00
|
|
|
const Client = require('./helpers/Client')
|
|
|
|
const request = require('request')
|
|
|
|
const ClsiApp = require('./helpers/ClsiApp')
|
2014-02-12 17:27:43 +00:00
|
|
|
|
2020-08-10 16:01:11 +00:00
|
|
|
describe('Deleting Old Files', function () {
|
|
|
|
before(function (done) {
|
2020-02-19 11:16:14 +00:00
|
|
|
this.request = {
|
|
|
|
resources: [
|
|
|
|
{
|
|
|
|
path: 'main.tex',
|
|
|
|
content: `\
|
2020-02-19 11:16:00 +00:00
|
|
|
\\documentclass{article}
|
|
|
|
\\begin{document}
|
|
|
|
Hello world
|
|
|
|
\\end{document}\
|
|
|
|
`
|
2020-02-19 11:16:14 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
return ClsiApp.ensureRunning(done)
|
|
|
|
})
|
2018-02-16 11:36:32 +00:00
|
|
|
|
2020-08-10 16:01:11 +00:00
|
|
|
return describe('on first run', function () {
|
|
|
|
before(function (done) {
|
2020-02-19 11:16:14 +00:00
|
|
|
this.project_id = Client.randomId()
|
|
|
|
return Client.compile(
|
|
|
|
this.project_id,
|
|
|
|
this.request,
|
|
|
|
(error, res, body) => {
|
|
|
|
this.error = error
|
|
|
|
this.res = res
|
|
|
|
this.body = body
|
|
|
|
return done()
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
2014-02-12 17:27:43 +00:00
|
|
|
|
2020-08-10 16:01:11 +00:00
|
|
|
it('should return a success status', function () {
|
2020-02-19 11:16:14 +00:00
|
|
|
return this.body.compile.status.should.equal('success')
|
|
|
|
})
|
2014-02-12 17:27:43 +00:00
|
|
|
|
2020-08-10 16:01:11 +00:00
|
|
|
return describe('after file has been deleted', function () {
|
|
|
|
before(function (done) {
|
2020-02-19 11:16:14 +00:00
|
|
|
this.request.resources = []
|
|
|
|
return Client.compile(
|
|
|
|
this.project_id,
|
|
|
|
this.request,
|
|
|
|
(error, res, body) => {
|
|
|
|
this.error = error
|
|
|
|
this.res = res
|
|
|
|
this.body = body
|
|
|
|
return done()
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
2014-02-12 17:27:43 +00:00
|
|
|
|
2020-08-10 16:01:11 +00:00
|
|
|
return it('should return a failure status', function () {
|
2020-02-19 11:16:14 +00:00
|
|
|
return this.body.compile.status.should.equal('failure')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|