Skip to content

Commit

Permalink
feat: auto detect .nycrc file (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed May 21, 2024
1 parent 0fd4d5d commit 50e315f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion borp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { parseArgs } from 'node:util'
import Reporters from 'node:test/reporters'
import { findUp } from 'find-up'
import { mkdtemp, rm, readFile } from 'node:fs/promises'
import { createWriteStream } from 'node:fs'
import { finished } from 'node:stream/promises'
Expand Down Expand Up @@ -141,10 +142,12 @@ try {
const localPrefix = relative(process.cwd(), config.prefix)
exclude = exclude.map((file) => posix.join(localPrefix, file))
}
const nycrc = await findUp(['.c8rc', '.c8rc.json', '.nycrc', '.nycrc.json'], { cwd: config.cwd })
const report = Report({
reporter: ['text'],
tempDirectory: covDir,
exclude
exclude,
...nycrc && JSON.parse(await readFile(nycrc, 'utf8'))
})

if (args.values['check-coverage']) {
Expand Down

0 comments on commit 50e315f

Please sign in to comment.