Skip to content

Commit 925e1ba

Browse files
committed
Try it
1 parent db01b5d commit 925e1ba

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

gulp/tasks/unit.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@ const unit = async function() {
1717
return gulpExeca('ava')
1818
}
1919

20-
await pack(
21-
`nyc --include node_modules/${name} --exclude !node_modules/${name} ava`,
22-
)
20+
await pack(`nyc --include ${NESTED_DIR} --exclude !${NESTED_DIR} ava`)
2321

22+
await sendToCoveralls()
23+
}
24+
25+
const sendToCoveralls = async function() {
2426
const covMap = await promisify(readFile)(COVMAP_PATH, { encoding: 'utf-8' })
25-
const covMapA = covMap.replace(NESTED_REGEXP, '')
27+
const covMapA = covMap.replace(NESTED_DIR_REGEXP, '')
2628

2729
await gulpExeca('coveralls', { input: covMapA })
2830
}
2931

30-
const NESTED_REGEXP = new RegExp(
32+
const NESTED_DIR = `node_modules/${name}`
33+
const NESTED_DIR_REGEXP = new RegExp(
3134
`node_modules(\\/|\\\\)${name}(\\/|\\\\)`,
3235
'gu',
3336
)

0 commit comments

Comments
 (0)