Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:36:20+00:00 2026-06-07T07:36:20+00:00

So I am trying to run unit tests with Mocha and Chai that are

  • 0

So I am trying to run unit tests with Mocha and Chai that are written in CoffeeScript. I know that Mocha has exclude coffeescript since 1.0 so I am passing the compiler flag mocha --compilers coffee:coffee-script. What ends up happening is that whenever I try to require a file in the test the compiler complains with this error. Otherwise it runs fine.

/usr/local/lib/coffee-script/lib/coffee-script.js:36
      throw err;
            ^
TypeError: In /Users/chietala/workspaces/twl/test/buttonTest.coffee, Array.prototype.indexOf called on null or undefined
    at indexOf (native)
    at Assign.exports.Assign.Assign.isStatement (/usr/local/lib/coffee-script/lib/nodes.js:1147:72)
    at Block.exports.Block.Block.compileNode (/usr/local/lib/coffee-script/lib/nodes.js:262:27)
    at Block.exports.Block.Block.compileWithDeclarations (/usr/local/lib/coffee-script/lib/nodes.js:308:19)
    at Block.exports.Block.Block.compileRoot (/usr/local/lib/coffee-script/lib/nodes.js:282:19)
    at Block.exports.Block.Block.compile (/usr/local/lib/coffee-script/lib/nodes.js:244:21)
    at exports.compile.compile (/usr/local/lib/coffee-script/lib/coffee-script.js:31:51)
    at Object.require.extensions..coffee (/usr/local/lib/coffee-script/lib/coffee-script.js:13:17)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at /usr/local/lib/node_modules/mocha/bin/_mocha:300:27
    at Array.forEach (native)
    at load (/usr/local/lib/node_modules/mocha/bin/_mocha:297:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:288:1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:487:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

All thats in my test file is the following

  ButtonConsumer = require '../button/base/coffee/ButtonConsumer'

And ButtonConsumer looks like this.

 class ButtonConsumer
  constructor: ->

directory structure is

/
   test
      buttonTest.coffee
   button
      base
        coffee
           ButtonConsumer.coffee

It’s pretty bare bones that’s why I’m really confused. I’m running Node v0.8.1, Coffeescript v1.2.0, and mocha 1.2.2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:36:21+00:00Added an answer on June 7, 2026 at 7:36 am

    Mocha does not work with CoffeeScript 1.2. Upgraded to 1.3.3 works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run some unit tests using QUnit written in CoffeeScript but there
I'm trying to run unit tests written in QUnit using jsTestDriver. I'm getting ReferenceError:
I'm trying to run the sample unit tests for the sample code that ships
I am trying to run unit tests in my TeamCity build that require openJPA
Trying to run Jison unit tests, but the command fails. How do I fix
I'm trying to run some unit-tests for NxBRE before I start referencing it's implementation
I am getting this exception when trying to run my PHP unit tests: Fatal
I'm trying to run Symfony 2 PHP unit tests for a REST API in
While trying to run all the unit tests in my solution(Visual Studio 2010) I
I am trying to run some unit tests using NUnit while I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.