Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for relative path option #1212

Merged
merged 4 commits into from Dec 17, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -57,6 +57,7 @@ class NYC {
this._showProcessTree = config.showProcessTree || false
this._eagerInstantiation = config.eager || false
this.cwd = config.cwd || process.cwd()
this.projectRoot = config.projectRoot || this.cwd
bgalletbgallet marked this conversation as resolved.
Show resolved Hide resolved
this.reporter = [].concat(config.reporter || 'text')

this.cacheDirectory = (config.cacheDir && path.resolve(config.cacheDir)) || findCacheDir({ name: 'nyc', cwd: this.cwd })
Expand Down Expand Up @@ -440,6 +441,7 @@ class NYC {
reports.create(_reporter, {
skipEmpty: this.config.skipEmpty,
skipFull: this.config.skipFull,
projectRoot: this.projectRoot,
bgalletbgallet marked this conversation as resolved.
Show resolved Hide resolved
maxCols: process.stdout.columns || 100
}).execute(context)
})
Expand Down