Cover all versioning paths

This commit is contained in:
Webber 2020-05-01 16:02:42 +02:00 committed by Webber Takken
parent c146049b33
commit a0a5de2a83

View File

@ -201,6 +201,17 @@ describe('Versioning', () => {
jest.spyOn(System, 'run').mockResolvedValue(null); jest.spyOn(System, 'run').mockResolvedValue(null);
await expect(Versioning.fetch()).resolves.not.toThrow(); await expect(Versioning.fetch()).resolves.not.toThrow();
}); });
it('falls back to the second strategy when the first fails', async () => {
jest.spyOn(core, 'warning').mockImplementation(() => {});
const gitFetch = jest
.spyOn(System, 'run')
.mockResolvedValue(null)
.mockRejectedValueOnce(null);
await expect(Versioning.fetch()).resolves.not.toThrow();
expect(gitFetch).toHaveBeenCalledTimes(2);
});
}); });
describe('generateSemanticVersion', () => { describe('generateSemanticVersion', () => {