devongovett / browserify-istanbul

A browserify transform for the istanbul code coverage tool
50 stars 32 forks source link

cannot exclude directory from source code report #21

Closed ghost closed 8 years ago

ghost commented 9 years ago

Hello,

I'm looking to use your project in setting up Karma for code coverage with Istanbul on a project which uses Browserify. There's a directory which contains vendor packages which I'm looking to exclude from the source code coverage report. I'm having trouble figuring out how to configure this. How can this be configure using your project? If it can't be configured using your project, is it possible to configure it using karma-coverage?

I know there's .istanbul.yml file which contains settings for exclusion of source files, however it appears that the .istanbul.yml in the root of my project is not having an impact on results.

Also, in your README example, what is "browserifyBundle"?

Thank you!

learntoswim commented 9 years ago

+1 - I can't seem to figure this out. Current code is:

        /**
         * Configuration for browserify test bundles.
         * @type {Object}
         */
        browserify: {
            debug: true,
            paths: ['app/third_party/js'],
            transform: [
                'partialify',
                ['browserify-istanbul', {ignore: ['app/third_party/js/**/*.js'], defaultIgnore: true}]
            ],
            extensions: ['.js', '.html', '.tpl']
        },
darlanalves commented 8 years ago

@karlstanton Replace app/third_party/js/**/*.js with **/app/third_party/js/**/*.js and it will probably work.

learntoswim commented 8 years ago

Yes, that worked.