Add newline to isShallow output

pull/216/head
David Finol 2021-02-13 00:46:15 -06:00
parent 8ce32519bf
commit cddc505539
3 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -211,7 +211,7 @@ export default class Versioning {
static async isShallow() { static async isShallow() {
const output = await this.git(['rev-parse', '--is-shallow-repository']); const output = await this.git(['rev-parse', '--is-shallow-repository']);
return output === 'true'; return output !== 'false\n';
} }
/** /**

View File

@ -240,13 +240,13 @@ describe('Versioning', () => {
describe('isShallow', () => { describe('isShallow', () => {
it('returns true when the repo is shallow', async () => { it('returns true when the repo is shallow', async () => {
const runOutput = 'true'; const runOutput = 'true\n';
jest.spyOn(System, 'run').mockResolvedValue(runOutput); jest.spyOn(System, 'run').mockResolvedValue(runOutput);
await expect(Versioning.isShallow()).resolves.toStrictEqual(true); await expect(Versioning.isShallow()).resolves.toStrictEqual(true);
}); });
it('returns false when the repo is not shallow', async () => { it('returns false when the repo is not shallow', async () => {
const runOutput = 'false'; const runOutput = 'false\n';
jest.spyOn(System, 'run').mockResolvedValue(runOutput); jest.spyOn(System, 'run').mockResolvedValue(runOutput);
await expect(Versioning.isShallow()).resolves.toStrictEqual(false); await expect(Versioning.isShallow()).resolves.toStrictEqual(false);
}); });