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 8124825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:35:37+00:00 2026-06-06T06:35:37+00:00

I am trying to play around with mocha running on node under Windows. I’ve

  • 0

I am trying to play around with mocha running on node under Windows. I’ve also decided why not throw some CoffeeScript in for fun.

describe 'Array', ->
  describe '#indexOf()', ->
    it 'should return -1 when not present' ->
      [1,2,3].indexOf(4).should.equal -1

The problem is that I am running into an error:

C:\Users\ShaneC\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\coffee-script.js:51
      throw err;
            ^
Error: In C:\projects\BowlingKata\test\test.coffee, Parse error on line 3: Unexpected '->'
    at Object.parseError (C:\Users\ShaneC\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\parser.js:477:11)
    at Object.parse (C:\Users\ShaneC\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\parser.js:554:22)
    at C:\Users\ShaneC\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\coffee-script.js:43:20
    at Object..coffee (C:\Users\ShaneC\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\coffee-script.js:19:17)
    at Module.load (module.js:353:31)

This is my mocha.opts file:

--reporter spec
--ui bdd
-r should
--compilers coffee:coffee-script

Any ideas on what I could be doing wrong? I’ve copied the code from http://net.tutsplus.com/tutorials/javascript-ajax/better-coffeescript-testing-with-mocha/ and nobody there is reporting any issues..

  • 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-06T06:35:39+00:00Added an answer on June 6, 2026 at 6:35 am

    Assuming that you are calling a function it, with arguments “should return -1 when not present”, and then a function to check this on, you need to separate the arguments with commas:

    describe 'Array', ->
      describe '#indexOf()', ->
        it 'should return -1 when not present', ->
          [1,2,3].indexOf(4).should.equal -1
    

    This compiles to:

    describe('Array', function() {
      return describe('#indexOf()', function() {
        return it('should return -1 when not present', function() {
          return [1, 2, 3].indexOf(4).should.equal(-1);
        });
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to play around with some music clustering algorithms, and I thought that
I am trying to switch my doctype to HTML5 to play around with some
Hi I am trying to play around with async.parallel and here is my code
I'm having a bit of a play around with IIS7, just trying to catch
I am trying to play audio in a Java applet but it is not
I'm trying to play with inter-process communication and since I could not figure out
I'm trying to play around with a RatingBar, but something is really wrong. <?xml
I'm brand spanking new to WPF and am trying to play around with projects
Trying to code a basic text editor to play around with Java's file objects
I am starting out to play around with Ruby and trying to make a

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.