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

Events are fired twice when using background: true #143

Open
4kochi opened this issue Feb 19, 2015 · 0 comments
Open

Events are fired twice when using background: true #143

4kochi opened this issue Feb 19, 2015 · 0 comments

Comments

@4kochi
Copy link

4kochi commented Feb 19, 2015

I developed a reporter for karma (https://github.com/litixsoft/karma-mocha-reporter) and have the issue that when the option background is true, the output of my reporter is not colored in the console.

I looked at you code and see that you do not set the stdio option for the node child process. This means the default is used (pipe). I set the option to stdio: 'inherit'and now the output of my reporter is colored.
But now i have the effect that the onSpecComplete or onRunComplete events are fired twice and i have duplicate output. Do you have any idea why this is happening.

Here the code i changed:

var backgroundArgs = {
        cmd: 'node',
          args: process.execArgv.concat([
              path.join(__dirname, '..', 'lib', 'background.js'),
              JSON.stringify(data)
          ]),
          opts: {
              stdio: 'inherit'
          }
      };

Btw, the progress reporter which is bundled in karma has a colored output even without the stdio option set.

Thanks.

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