-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: corrects exception on diff command and removes redundant share o…
…perator (#63) * fix(cli): Corrects exception on diff command, closes #61 * chore(cli): Removes redundant share operator * chore: add basic e2e test for diff
- Loading branch information
Showing
2 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {runWithOptions} from './cli-helper.js'; | ||
|
||
const REPORT_001_FILEPATH = require.resolve( | ||
'@report-toolkit/common/test/fixture/reports/report-001.json' | ||
); | ||
const REPORT_002_FILEPATH = require.resolve( | ||
'@report-toolkit/common/test/fixture/reports/report-002-library-mismatch.json' | ||
); | ||
|
||
describe('@report-toolkit/cli:command:diff', function() { | ||
describe('when run with a single report file', function() { | ||
it('should exit with code 1', function() { | ||
return expect( | ||
runWithOptions(['diff', REPORT_001_FILEPATH]), | ||
'to be rejected with error satisfying', | ||
{ | ||
exitCode: 1 | ||
} | ||
); | ||
}); | ||
}); | ||
|
||
describe('when run with two report files', function() { | ||
it('should exit with code 0', function() { | ||
return expect( | ||
runWithOptions(['diff', REPORT_001_FILEPATH, REPORT_002_FILEPATH]), | ||
'to be fulfilled with value satisfying', | ||
{ | ||
exitCode: 0 | ||
} | ||
); | ||
}); | ||
}); | ||
}); |