@nielse63/generate-tests
v1.1.8
Published
Automatically generate jest specs for uncovered source files
Downloads
3
Readme
@nielse63/generate-tests
Automatically generate jest specs for uncovered source files
Installation
npm -g i @nielse63/generate-tests
Usage
CLI
$ generate-tests --help
Usage: generate-tests [options] <glob>
Automatically generate jest specs for uncovered source files
Arguments:
glob Glob pattern of source files
Options:
-D, --cwd Current working directory
-V, --version output the version number
-h, --help display help for command
API
import generateTests from '@nielse63/generate-tests';
const results = await generateTests({
cwd: '/path/to/project',
glob: '**/src/**.{js,ts}',
});
// results:
// [
// {
// file: 'src/file.js',
// abspath: '/path/to/project/src/file.js',
// testpath: '/path/to/project/src/__tests__/file.spec.js',
// basename: 'file.js',
// classname: 'file'
// }
// ]