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

how can i merge any report in one? #4

Open
smildlzj opened this issue Jan 9, 2017 · 1 comment
Open

how can i merge any report in one? #4

smildlzj opened this issue Jan 9, 2017 · 1 comment

Comments

@smildlzj
Copy link

smildlzj commented Jan 9, 2017

hi,
my project use webpack as build tools,so some mobules was import by any pages.

but the coverage report is worng , and overwrite by the last test file.

gulp
    .src('./build/**/*.test.html', {read: false})
    .pipe(mochaPhantomJS({
      reporter: 'list',
      phantomjs: {
        settings : {
          localToRemoteUrlAccessEnabled : true,
          webSecurityEnabled : false,
        },
        useColors: true,
        viewportSize : {
          width: 800,
          height: 600
        },
        hooks: 'mocha-phantomjs-istanbul',
        coverageFile: './coverage/coverage.json'
      }
    }))
    .on('finish', function() {
      gulp.src('./coverage/coverage.json')
        .pipe(istanbulReport({
          reporterOpts: {
            dir: './coverage'
          },
          reporters: ['html']
        }))
    });
@smurfpandey
Copy link

I have made few tweaks in my fork to handle this use-case. Now the coverage report from each test gets appended in the coverageFile. You can check the changes here:
https://github.com/smurfpandey/mocha-phantomjs-istanbul

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