overleaf/services/clsi/test/acceptance/coffee/TimeoutTests.coffee

32 lines
738 B
CoffeeScript
Raw Normal View History

Client = require "./helpers/Client"
request = require "request"
require("chai").should()
ClsiApp = require "./helpers/ClsiApp"
2014-02-12 12:27:43 -05:00
describe "Timed out compile", ->
before (done) ->
@request =
options:
2018-09-11 06:34:25 -04:00
timeout: 10 #seconds
resources: [
path: "main.tex"
content: '''
\\documentclass{article}
\\begin{document}
2018-09-11 06:34:25 -04:00
\\def\\x{Hello!\\par\\x}
\\x
\\end{document}
'''
]
@project_id = Client.randomId()
ClsiApp.ensureRunning =>
Client.compile @project_id, @request, (@error, @res, @body) => done()
2014-02-12 12:27:43 -05:00
it "should return a timeout error", ->
@body.compile.error.should.equal "container timed out"
2014-02-12 12:27:43 -05:00
it "should return a timedout status", ->
@body.compile.status.should.equal "timedout"
2014-02-12 12:27:43 -05:00