Files
overleaf-cep/services/clsi/test/acceptance/js/TimeoutTests.js
T
Andrew Rumble cd7da983d1 Merge pull request #30232 from overleaf/ar/convert-clsi-to-es-modules
[clsi] convert to ES modules

GitOrigin-RevId: fb7fa52cc8f678ee31be352e62a5dff95e88008b
2026-01-22 09:06:23 +00:00

46 lines
1.1 KiB
JavaScript

import Client from './helpers/Client.js'
import ClsiApp from './helpers/ClsiApp.js'
import { expect } from 'chai'
describe('Timed out compile', function () {
before(async function () {
this.request = {
options: {
timeout: 10,
}, // seconds
resources: [
{
path: 'main.tex',
content: `\
\\documentclass{article}
\\begin{document}
\\def\\x{Hello!\\par\\x}
\\x
\\end{document}\
`,
},
],
}
this.project_id = Client.randomId()
await ClsiApp.ensureRunning()
this.body = await Client.compile(this.project_id, this.request)
})
it('should return a timeout error', function () {
this.body.compile.error.should.equal('container timed out')
})
it('should return a timedout status', function () {
this.body.compile.status.should.equal('timedout')
})
it('should return isInitialCompile flag', function () {
expect(this.body.compile.stats.isInitialCompile).to.equal(1)
})
it('should return the log output file name', function () {
const outputFilePaths = this.body.compile.outputFiles.map(x => x.path)
outputFilePaths.should.include('output.log')
})
})