Skip to content

Commit

Permalink
Add integration test to match unit test for checkIsRepo
Browse files Browse the repository at this point in the history
  • Loading branch information
steveukx committed Apr 10, 2020
1 parent f0c080e commit 5a2b4cd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/test-check-is-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ const setUp = (context) => {
};

require('../jestify')({

'throws errors other than in-repo detection errors': new Test(setUp, (context, assert) => {

const git = context.gitP(context.realRoot).customBinary('nonsense');

return git.checkIsRepo()
.then(
() => new Error('Errors other than detecting a repo should be treated as errors'),
(err) => assert.ok(/nonsense/.test(err.message)),
);

}),

'reports true for a real root': new Test(setUp, function (context, assert) {
const expected = true;
const git = context.gitP(context.realRoot);
Expand Down

0 comments on commit 5a2b4cd

Please sign in to comment.