Skip to content

Unable to use book in unit testing using mocha #1

@salmankhann

Description

@salmankhann

Hello, Great work! The hook works perfectly when I do a sails lift on the console, but while running unit tests through mocha, it fails with a syntax error,

"before all" hook:

Uncaught /Users/salmanhasratkhan/Desktop/es6_trial/api/controllers/TestController.js:4
        console.log(__.ifNot(s => s == 2, 2));
                               ^^
Unexpected token =>

this is the way I lift sails in mocha

console.log('bootstrap before');
    Sails.lift({
        //configuration for testing purposes
        hooks: {
            // Load the hook
            "babel": require('../../../'),
            // Skip grunt
            "grunt": false
        },
        log: {
            level: "error"
        }

    });

Any ideas what is preventing it from working correctly? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions