Skip to content

Commit

Permalink
Merge branch 'main' into additional-config-files
Browse files Browse the repository at this point in the history
  • Loading branch information
mcknasty committed Jan 16, 2024
2 parents 27d619c + bf3073b commit 34900ce
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/parse-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
loadConfigFile
} = require('../lib/parse-args')

const { join } = require('path')
const { join, resolve } = require('path')
const { existsSync } = require('fs')
const { assert } = require('chai')
const chaiJestSnapshot = require('chai-jest-snapshot')
Expand Down Expand Up @@ -174,6 +174,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 34900ce

Please sign in to comment.