UziTech / atom-jasmine2-test-runner

A test runner for Atom
https://www.npmjs.com/package/atom-jasmine2-test-runner
MIT License
3 stars 2 forks source link

Support for code coverage #13

Open lgeiger opened 7 years ago

lgeiger commented 7 years ago

Thanks a lot for making this package!

For Atom packages using the integrated test runner it isn't possible to use tools like Istanbul for getting code coverage reports.

It would be a killer feature if atom-jasmine2-test-runner could provide a way to get coverage reports with one of those tools.

UziTech commented 6 years ago

How would this work. I've personally never used Istanbul for any projects. Is there a code coverage tool that works with Atom tests?

I recently created a test to show linting errors in a project and was thinking about adding that as well to this test runner.


    if (!global.headless) {
        // show linting errors in atom test window
        describe('linting', function () {
            it('should pass linting', function (done) {
                const { exec } = require('child_process');
                exec('npm run lint', {
                    cwd: __dirname
                }, function (err, stdout) {
                    if (err) {
                        expect(stdout).toBeFalsy();
                    }

                    done();
                });
            }, 60000);
        });
    }

The expect is only run if there is an error and displays stdout