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

error while running same grunt nodeunit task twice #50

Open
sameercaresu opened this issue Sep 8, 2017 · 0 comments
Open

error while running same grunt nodeunit task twice #50

sameercaresu opened this issue Sep 8, 2017 · 0 comments

Comments

@sameercaresu
Copy link

I want to run same nodeunit test twice but it gives me error "Fatal error: test after end() was called"

For example:

Setup

nodeunit:{
  src: ['test.js'],
    options: {
      reporter: 'tap'
  }
}
grunt.registerTask('test', 'Run unit test', function (context) {
    process.env.TEST = "TEST1";
    grunt.task.run('nodeunit');
    // change the environment variable
    process.env.TEST = "TEST2";
    grunt.task.run("nodeunit");
});

test.js

    exports.test = {
      setUp: function (callback) {
        callback();
      },
      tearDown: function (callback) {
        callback();
      },
      "test 1": function (test) {
        test.equal(doSomething(process.env.TEST), true, "should pass with env var:" + process.env.TEST);
        test.done();
      }
   };

Error while running second grunt.task.run

Fatal error: test after end() was called

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

1 participant