Add newline to isShallow output (#216)

* Add newline to isShallow output
This commit is contained in:
David Finol 2021-02-13 01:40:19 -06:00 committed by GitHub
parent faefe2f8d7
commit 414307a791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}); });