From 35254be989c7b9875977af0b14ddb4c5f7bf96f5 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 3 Mar 2015 14:25:54 +0000 Subject: [PATCH] fix up the aspell tests --- services/spelling/package.json | 1 + services/spelling/test/unit/coffee/ASpellTests.coffee | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/services/spelling/package.json b/services/spelling/package.json index 6e24604b29..70ec542cd8 100644 --- a/services/spelling/package.json +++ b/services/spelling/package.json @@ -10,6 +10,7 @@ "dependencies": { "async": "0.1.22", "body-parser": "^1.12.0", + "coffee-script": "^1.9.1", "express": "^4.12.1", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.0.0", "lru-cache": "^2.5.0", diff --git a/services/spelling/test/unit/coffee/ASpellTests.coffee b/services/spelling/test/unit/coffee/ASpellTests.coffee index 99c0d8a7b9..94a997d424 100644 --- a/services/spelling/test/unit/coffee/ASpellTests.coffee +++ b/services/spelling/test/unit/coffee/ASpellTests.coffee @@ -1,10 +1,12 @@ sinon = require 'sinon' chai = require 'chai' should = chai.should() +SandboxedModule = require('sandboxed-module') +assert = require("chai").assert describe "ASpell", -> beforeEach -> - @ASpell = require("../../../app/js/ASpell") + @ASpell = SandboxedModule.require "../../../app/js/ASpell", requires:{} describe "a correctly spelled word", -> beforeEach (done) -> @@ -44,11 +46,11 @@ describe "ASpell", -> it "should return a blank array", -> @result.length.should.equal 1 - @result[0].suggestions.should.deep.equal [] + assert.deepEqual @result[0].suggestions, [] describe "when the request times out", -> beforeEach (done) -> - words = ("abcdefg" for i in [0..1000000]) + words = ("abcdefg" for i in [0..1000]) @ASpell.ASPELL_TIMEOUT = 100 @start = new Date() @ASpell.checkWords "en", words, (error, @result) => done()