Skip to content

Commit

Permalink
feat(init): improve test:coverage script (#915)
Browse files Browse the repository at this point in the history
For example, Jest supports the `--coverage` flag.
  • Loading branch information
ybiquitous authored Apr 2, 2021
1 parent f40e189 commit cdfdad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const initCommand = (baseDir, logger) => {
scripts.test = "test";
}
scripts["test:watch"] = `${scripts.test} --watch`;
scripts["test:coverage"] = 'echo "unsupported." && exit 1';
scripts["test:coverage"] = `${scripts.test} --coverage`;
Object.keys(originalPackage.scripts)
.filter((key) => !(key === "test" || key.startsWith("test:")))
.forEach((key) => {
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/init.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Object {
"release": "standard-version",
"release:dry-run": "standard-version --dry-run",
"test": "abc",
"test:coverage": "echo \\"unsupported.\\" && exit 1",
"test:coverage": "abc --coverage",
"test:watch": "abc --watch",
},
"standard-version": Object {
Expand Down Expand Up @@ -129,7 +129,7 @@ Object {
"release": "standard-version",
"release:dry-run": "standard-version --dry-run",
"test": "test",
"test:coverage": "echo \\"unsupported.\\" && exit 1",
"test:coverage": "test --coverage",
"test:watch": "test --watch",
},
"standard-version": Object {
Expand Down

0 comments on commit cdfdad9

Please sign in to comment.