Skip to content

Ensure code coverage reports run for all files, especially those with no tests

License

Notifications You must be signed in to change notification settings

tchcxp/grunt-jest-enforcer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-jest-enforcer

Getting Started:

This plugin is to find all files matching a list of patterns and create a new file, which will be executed by test framework (eg. jest). The new file requires all matched files from the list above.

npm install grunt-jest-enforcer --save-dev

Examples:

Sample grunt file :

src: the list of patterens that file will match.

dest: the output file requires all matched files.

	jest_enforcer: {
            options: {
            },
            files: {
                src: [ './sample_source/**/test*.js*' ],
                dest: './sample_output/requireFiles.js',
            }
        }

Sample output:

The test framework (eg. jest) can run this file and you will get test coverage report for all required files.

var __sample_source_test_1_js = require('./../sample_source/test_1.js');
var __sample_source_test_3_jsx = require('./../sample_source/test_3.jsx');
var __sample_source_test_4_js = require('./../sample_source/test_4.js');

About

Ensure code coverage reports run for all files, especially those with no tests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%