diff --git a/test/integration.js.snap b/test/integration.js.snap index 821d99071..17b8615e7 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------- -All files | 1.81 | 12.24 | 6.38 | 1.81 | +All files | 1.55 | 11.53 | 6 | 1.55 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -165,6 +165,10 @@ All files | 1.81 | 12.24 | 6.38 | 1.81 block-navigation.js | 0 | 0 | 0 | 0 | 1-87 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 + c8/coverage/lcov-report | 0 | 0 | 0 | 0 | + block-navigation.js | 0 | 0 | 0 | 0 | 1-87 + prettify.js | 0 | 0 | 0 | 0 | 1-2 + sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | is-cjs-esm-bridge.js | 0 | 0 | 0 | 0 | 1-10 parse-args.js | 0 | 0 | 0 | 0 | 1-224 @@ -522,7 +526,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------- -All files | 1.81 | 12.24 | 6.38 | 1.81 | +All files | 1.55 | 11.53 | 6 | 1.55 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -531,6 +535,10 @@ All files | 1.81 | 12.24 | 6.38 | 1.81 block-navigation.js | 0 | 0 | 0 | 0 | 1-87 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 + c8/coverage/lcov-report | 0 | 0 | 0 | 0 | + block-navigation.js | 0 | 0 | 0 | 0 | 1-87 + prettify.js | 0 | 0 | 0 | 0 | 1-2 + sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | is-cjs-esm-bridge.js | 0 | 0 | 0 | 0 | 1-10 parse-args.js | 0 | 0 | 0 | 0 | 1-224 diff --git a/test/parse-args.js b/test/parse-args.js index 004c72413..fa2d5267a 100644 --- a/test/parse-args.js +++ b/test/parse-args.js @@ -6,7 +6,7 @@ const { hideInstrumenterArgs } = require('../lib/parse-args') -const { join } = require('path') +const { join, resolve } = require('path') describe('parse-args', () => { describe('hideInstrumenteeArgs', () => { @@ -63,6 +63,28 @@ describe('parse-args', () => { argv.lines.should.be.equal(100) argv.functions.should.be.equal(24) }) + it('should allow relative path reports directories', () => { + const argsArray = ['node', 'c8', '--lines', '100', '--reports-dir', './coverage_'] + const argv = buildYargs().parse(argsArray) + argv.reportsDir.should.be.equal('./coverage_') + }) + it('should allow relative path temporary directories', () => { + const argsArray = ['node', 'c8', '--lines', '100', '--temp-directory', './coverage/tmp_'] + const argv = buildYargs().parse(argsArray) + argv.tempDirectory.should.be.equal('./coverage/tmp_') + }) + it('should allow absolute path reports directories', () => { + const tmpDir = resolve(process.cwd(), 'coverage_') + const argsArray = ['node', 'c8', '--lines', '100', '--reports-dir', tmpDir] + const argv = buildYargs().parse(argsArray) + argv.reportsDir.should.be.equal(tmpDir) + }) + it('should allow absolute path temporary directories', () => { + const tmpDir = resolve(process.cwd(), './coverage/tmp_') + const argsArray = ['node', 'c8', '--lines', '100', '--temp-directory', tmpDir] + const argv = buildYargs().parse(argsArray) + argv.tempDirectory.should.be.equal(tmpDir) + }) }) describe('--merge-async', () => {