decaffeinate: Convert BrokenLatexFileTests.coffee and 9 other files to JS
This commit is contained in:
@@ -1,34 +1,48 @@
|
||||
Client = require "./helpers/Client"
|
||||
request = require "request"
|
||||
require("chai").should()
|
||||
ClsiApp = require "./helpers/ClsiApp"
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const Client = require("./helpers/Client");
|
||||
const request = require("request");
|
||||
require("chai").should();
|
||||
const ClsiApp = require("./helpers/ClsiApp");
|
||||
|
||||
|
||||
describe "Timed out compile", ->
|
||||
before (done) ->
|
||||
@request =
|
||||
options:
|
||||
timeout: 10 #seconds
|
||||
resources: [
|
||||
path: "main.tex"
|
||||
content: '''
|
||||
\\documentclass{article}
|
||||
\\begin{document}
|
||||
\\def\\x{Hello!\\par\\x}
|
||||
\\x
|
||||
\\end{document}
|
||||
'''
|
||||
describe("Timed out compile", function() {
|
||||
before(function(done) {
|
||||
this.request = {
|
||||
options: {
|
||||
timeout: 10
|
||||
}, //seconds
|
||||
resources: [{
|
||||
path: "main.tex",
|
||||
content: `\
|
||||
\\documentclass{article}
|
||||
\\begin{document}
|
||||
\\def\\x{Hello!\\par\\x}
|
||||
\\x
|
||||
\\end{document}\
|
||||
`
|
||||
}
|
||||
]
|
||||
@project_id = Client.randomId()
|
||||
ClsiApp.ensureRunning =>
|
||||
Client.compile @project_id, @request, (@error, @res, @body) => done()
|
||||
};
|
||||
this.project_id = Client.randomId();
|
||||
return ClsiApp.ensureRunning(() => {
|
||||
return Client.compile(this.project_id, this.request, (error, res, body) => { this.error = error; this.res = res; this.body = body; return done(); });
|
||||
});
|
||||
});
|
||||
|
||||
it "should return a timeout error", ->
|
||||
@body.compile.error.should.equal "container timed out"
|
||||
it("should return a timeout error", function() {
|
||||
return this.body.compile.error.should.equal("container timed out");
|
||||
});
|
||||
|
||||
it "should return a timedout status", ->
|
||||
@body.compile.status.should.equal "timedout"
|
||||
it("should return a timedout status", function() {
|
||||
return this.body.compile.status.should.equal("timedout");
|
||||
});
|
||||
|
||||
it "should return the log output file name", ->
|
||||
outputFilePaths = @body.compile.outputFiles.map((x) => x.path)
|
||||
outputFilePaths.should.include('output.log')
|
||||
return it("should return the log output file name", function() {
|
||||
const outputFilePaths = this.body.compile.outputFiles.map(x => x.path);
|
||||
return outputFilePaths.should.include('output.log');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user