Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Running Multiple, Second Iteration Does not Execute #36

Open
benmarten opened this issue May 4, 2015 · 2 comments
Open

When Running Multiple, Second Iteration Does not Execute #36

benmarten opened this issue May 4, 2015 · 2 comments

Comments

@benmarten
Copy link

I am using env and simple mocha:

// Register Single Tasks
grunt.registerTask('phantomjs', ['env:phantomjs', 'simplemocha']);
grunt.registerTask('firefox', ['env:firefox', 'simplemocha']);

// Register Combined Tasks
grunt.registerTask('all', ['env:phantomjs', 'simplemocha', 'env:firefox', 'simplemocha']);

Running manually in console grunt phantomjs and then afterwards grunt firefox works.
But when running grunt all, it outputs only this for the second task (firefox):

....
Running "env:firefox" (env) task

Running "simplemocha:all" (simplemocha) task


  0 passing (0ms)

This is my env config:

    env: {
        phantomjs: {
            NODE_ENV: 'config-phantomjs'
        },
        firefox: {
            NODE_ENV: 'config-firefox'
        }
    }

Any ideas why this is not running as expected all together?

@stephanebachelier
Copy link
Collaborator

@benmarten just a side not, why did you not use the following notation ?

grunt.registerTask('all', ['phantomjs', 'firefox']);

Could you share your configuration and some log runnning grunt all -v -d

@benmarten
Copy link
Author

Not sure, I thought it needed to be configured like this... Anyway I also tried your suggestion, but with same effect... Here's my configuration:

/* global require,module */
'use strict';
var nconf = require('nconf');

module.exports = function(grunt) {
    nconf.env()
        .argv();
    grunt.initConfig({
        env: {
            phantomjs: {
                NODE_ENV: 'config-phantomjs'
            },
            firefox: {
                NODE_ENV: 'config-firefox'
            }
        },
        simplemocha: {
            options: {
                globals: ['should'],
                timeout: 600000,
                slow: 600000,
                ignoreLeaks: true,
                grep: grunt.option('grep') || 0,
                ui: 'bdd',
                reporter: 'spec'
            },
            all: {
                src: ['test/*.js']
            }
        }
    });

    // Load Grunt Tasks
    grunt.loadNpmTasks('grunt-env');
    grunt.loadNpmTasks('grunt-simple-mocha');

    // Register Single Tasks
    grunt.registerTask('phantomjs', ['env:phantomjs', 'simplemocha']);
    grunt.registerTask('firefox', ['env:firefox', 'simplemocha']);

    grunt.registerTask('all', ['phantomjs', 'firefox']);
};

Both work, but not together... then firefox won't execute:
[...]
2 passing (2s)

Running "env:firefox" (env) task

Running "simplemocha:all" (simplemocha) task


  0 passing (0ms)


Done, without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants