fix(v2): read last update from inner git repositories (#5048)

This commit is contained in:
Felipe Santos 2021-06-24 10:05:22 -03:00 committed by GitHub
parent aa79387e12
commit f47826297c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View file

@ -31,15 +31,16 @@ describe('lastUpdate', () => {
test('non-existing file', async () => {
const consoleMock = jest.spyOn(console, 'error');
consoleMock.mockImplementation();
const nonExistingFileName = '.nonExisting';
const nonExistingFilePath = path.join(
__dirname,
'__fixtures__',
'.nonExisting',
nonExistingFileName,
);
expect(await getFileLastUpdate(nonExistingFilePath)).toBeNull();
expect(consoleMock).toHaveBeenCalledTimes(1);
expect(consoleMock.mock.calls[0][0].message).toContain(
`Command failed with exit code 128: git log -1 --format=%ct, %an ${nonExistingFilePath}`,
`Command failed with exit code 128: git log -1 --format=%ct, %an ${nonExistingFileName}`,
);
expect(await getFileLastUpdate(null)).toBeNull();
expect(await getFileLastUpdate(undefined)).toBeNull();