Skip to content

Instantly share code, notes, and snippets.

@robksawyer
Created November 26, 2014 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robksawyer/17fb39e63fff5c24ed8e to your computer and use it in GitHub Desktop.
Save robksawyer/17fb39e63fff5c24ed8e to your computer and use it in GitHub Desktop.
'use strict';
/*
* Location: /test/bootstrap.test.js
*
* @description :: This file is run before all other tests.
*/
var should = require('chai').should(),
appHelper = require('./helpers/appHelper');
before('bootstrap', function (done) {
appHelper.lift(done);
});
//...
// Global after hook
after('bootstrap', function (done) {
appHelper.lower(done);
});
@robksawyer
Copy link
Author

Keeps throwing the error.

$ grunt test
Running "mocha_istanbul:coverage" (mocha_istanbul) task
>> Warning: mocha.opts exists, but overwriting with options


  1) "before all" hook: bootstrap

  0 passing (4ms)
  1 failing

  1)  "before all" hook: bootstrap:
     Uncaught TypeError: object is not a function
      at /Users/.../test/helpers/appHelper.js:33:11
      at fn (/Users/.../node_modules/async/lib/async.js:641:34)
      at Object._onImmediate (/Users/.../node_modules/async/lib/async.js:557:34)
      at processImmediate [as _immediateCallback] (timers.js:345:15)

No coverage information was collected, exit without writing coverage information
>>
Warning: Task "mocha_istanbul:coverage" failed. Use --force to continue.

Aborted due to warnings.

@robksawyer
Copy link
Author

FIXED: The issue was actually in appHelper.js. I had to remove the parenthesis from Sails i.e. Sails().lift to Sails.lift.

@robksawyer
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment