decaffeinate: Convert BrokenLatexFileTests.coffee and 9 other files to JS
This commit is contained in:
@@ -1,38 +1,52 @@
|
||||
Client = require "./helpers/Client"
|
||||
request = require "request"
|
||||
require("chai").should()
|
||||
expect = require("chai").expect
|
||||
path = require("path")
|
||||
fs = require("fs")
|
||||
ClsiApp = require "./helpers/ClsiApp"
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* 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 { expect } = require("chai");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const ClsiApp = require("./helpers/ClsiApp");
|
||||
|
||||
describe "Syncing", ->
|
||||
before (done) ->
|
||||
@request =
|
||||
resources: [
|
||||
path: "main.tex"
|
||||
describe("Syncing", function() {
|
||||
before(function(done) {
|
||||
this.request = {
|
||||
resources: [{
|
||||
path: "main.tex",
|
||||
content: fs.readFileSync(path.join(__dirname,"../fixtures/naugty_strings.txt"),"utf-8")
|
||||
}
|
||||
]
|
||||
@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(); });
|
||||
});
|
||||
});
|
||||
|
||||
describe "wordcount file", ->
|
||||
it "should return wordcount info", (done) ->
|
||||
Client.wordcount @project_id, "main.tex", (error, result) ->
|
||||
throw error if error?
|
||||
expect(result).to.deep.equal(
|
||||
return describe("wordcount file", () =>
|
||||
it("should return wordcount info", function(done) {
|
||||
return Client.wordcount(this.project_id, "main.tex", function(error, result) {
|
||||
if (error != null) { throw error; }
|
||||
expect(result).to.deep.equal({
|
||||
texcount: {
|
||||
encode: "utf8"
|
||||
textWords: 2281
|
||||
headWords: 2
|
||||
outside: 0
|
||||
headers: 2
|
||||
elements: 0
|
||||
mathInline: 6
|
||||
mathDisplay: 0
|
||||
errors: 0
|
||||
encode: "utf8",
|
||||
textWords: 2281,
|
||||
headWords: 2,
|
||||
outside: 0,
|
||||
headers: 2,
|
||||
elements: 0,
|
||||
mathInline: 6,
|
||||
mathDisplay: 0,
|
||||
errors: 0,
|
||||
messages: ""
|
||||
}
|
||||
)
|
||||
done()
|
||||
});
|
||||
return done();
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user