|
6 | 6 | hideInstrumenterArgs
|
7 | 7 | } = require('../lib/parse-args')
|
8 | 8 |
|
9 |
| -const { join } = require('path') |
| 9 | +const { join, resolve } = require('path') |
10 | 10 |
|
11 | 11 | describe('parse-args', () => {
|
12 | 12 | describe('hideInstrumenteeArgs', () => {
|
@@ -63,6 +63,28 @@ describe('parse-args', () => {
|
63 | 63 | argv.lines.should.be.equal(100)
|
64 | 64 | argv.functions.should.be.equal(24)
|
65 | 65 | })
|
| 66 | + it('should allow relative path reports directories', () => { |
| 67 | + const argsArray = ['node', 'c8', '--lines', '100', '--reports-dir', './coverage_'] |
| 68 | + const argv = buildYargs().parse(argsArray) |
| 69 | + argv.reportsDir.should.be.equal('./coverage_') |
| 70 | + }) |
| 71 | + it('should allow relative path temporary directories', () => { |
| 72 | + const argsArray = ['node', 'c8', '--lines', '100', '--temp-directory', './coverage/tmp_'] |
| 73 | + const argv = buildYargs().parse(argsArray) |
| 74 | + argv.tempDirectory.should.be.equal('./coverage/tmp_') |
| 75 | + }) |
| 76 | + it('should allow absolute path reports directories', () => { |
| 77 | + const tmpDir = resolve(process.cwd(), 'coverage_') |
| 78 | + const argsArray = ['node', 'c8', '--lines', '100', '--reports-dir', tmpDir] |
| 79 | + const argv = buildYargs().parse(argsArray) |
| 80 | + argv.reportsDir.should.be.equal(tmpDir) |
| 81 | + }) |
| 82 | + it('should allow absolute path temporary directories', () => { |
| 83 | + const tmpDir = resolve(process.cwd(), './coverage/tmp_') |
| 84 | + const argsArray = ['node', 'c8', '--lines', '100', '--temp-directory', tmpDir] |
| 85 | + const argv = buildYargs().parse(argsArray) |
| 86 | + argv.tempDirectory.should.be.equal(tmpDir) |
| 87 | + }) |
66 | 88 | })
|
67 | 89 |
|
68 | 90 | describe('--merge-async', () => {
|
|
0 commit comments