Skip to content

Commit

Permalink
Merge branch 'main' into lib-report-code-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mcknasty committed Jan 16, 2024
2 parents a6962e1 + bf3073b commit 6a6f0e7
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/parse-args.js
Expand Up @@ -6,7 +6,7 @@ const {
hideInstrumenterArgs
} = require('../lib/parse-args')

const { join } = require('path')
const { join, resolve } = require('path')

describe('parse-args', () => {
describe('hideInstrumenteeArgs', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 6a6f0e7

Please sign in to comment.