From b07b7a84be650575ec8fdab1f7787a1d04126d19 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 11 Sep 2018 10:21:37 +0100 Subject: [PATCH] fix unit tests --- app/coffee/CompileManager.coffee | 5 +++-- test/unit/coffee/CompileManagerTests.coffee | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/coffee/CompileManager.coffee b/app/coffee/CompileManager.coffee index 9c28535..eff20eb 100644 --- a/app/coffee/CompileManager.coffee +++ b/app/coffee/CompileManager.coffee @@ -282,12 +282,13 @@ module.exports = CompileManager = } return results + wordcount: (project_id, user_id, file_name, image, callback = (error, pdfPositions) ->) -> logger.log project_id:project_id, user_id:user_id, file_name:file_name, image:image, "running wordcount" file_path = "$COMPILE_DIR/" + file_name command = [ "texcount", '-nocol', '-inc', file_path, "-out=" + file_path + ".wc"] - directory = getCompileDir(project_id, user_id) - timeout = 60 * 1000 # increased to allow for large projects + compileDir = getCompileDir(project_id, user_id) + timeout = 60 * 1000 compileName = getCompileName(project_id, user_id) fse.ensureDir compileDir, (error) -> if error? diff --git a/test/unit/coffee/CompileManagerTests.coffee b/test/unit/coffee/CompileManagerTests.coffee index 26524fb..608a3e5 100644 --- a/test/unit/coffee/CompileManagerTests.coffee +++ b/test/unit/coffee/CompileManagerTests.coffee @@ -269,7 +269,7 @@ describe "CompileManager", -> ['/opt/synctex', 'code', synctex_path, file_path, @line, @column], "#{@Settings.path.compilesDir}/#{@project_id}-#{@user_id}", @Settings.clsi.docker.image, - 10000, + 60000, {} ).should.equal true @@ -300,7 +300,7 @@ describe "CompileManager", -> ['/opt/synctex', "pdf", synctex_path, @page, @h, @v], "#{@Settings.path.compilesDir}/#{@project_id}-#{@user_id}", @Settings.clsi.docker.image, - 10000, + 60000, {}).should.equal true it "should call the callback with the parsed output", ->