Add test for unsafe repo detection

This commit is contained in:
Sergio Padrino 2022-07-14 09:26:20 +02:00
parent 597930d9dc
commit d7e079fd37

View file

@ -101,5 +101,13 @@ describe('git/rev-parse', () => {
kind: 'missing',
})
})
it('returns unsafe for unsafe repository', async () => {
process.env['GIT_TEST_ASSUME_DIFFERENT_OWNER'] = '1'
expect(await getRepositoryType(repository.path)).toMatchObject({
kind: 'unsafe',
})
process.env['GIT_TEST_ASSUME_DIFFERENT_OWNER'] = undefined
})
})
})