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 to cover all the files in the directory recursively #11

Open
aamin3189 opened this issue Jan 7, 2017 · 3 comments
Open

How to cover all the files in the directory recursively #11

aamin3189 opened this issue Jan 7, 2017 · 3 comments

Comments

@aamin3189
Copy link

How to cover all the files in the directory recursively

@nelsonic
Copy link
Member

nelsonic commented Jan 8, 2017

@aamin3189 great question! the easiest way to do this is to use an .istanbul.yml file, do you already have one?

@aamin3189
Copy link
Author

aamin3189 commented Jan 12, 2017

Thanks @nelsonic . After a little digging I have found that we can write a gulp task to generate coverage report for all the files,

var gulp = require('gulp');
var istanbul = require('gulp-istanbul');

gulp.task('test', function () {
    return gulp.src(['./test/**/*.js'])
      // Right there
      .pipe(istanbul({includeUntested: true}))
      .on('finish', function () {
        gulp.src(['./test/**/*.js'])
          .pipe(istanbul.writeReports({
            dir: './coverage',
            reporters: [ 'lcov' ],
            reportOpts: { dir: './coverage'}
          }));
      });
  });

@nelsonic
Copy link
Member

@aamin3189 that should do the trick if you are already using gulp for your build tasks. 👍

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

No branches or pull requests

2 participants