Skip to content

Commit 0b26e61

Browse files
committed
add test
1 parent b8ee582 commit 0b26e61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/git-operations.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
getRepositoryHttpsUrl,
1010
getTags,
1111
} from './git-operations';
12+
import type { PackageMetadata } from './package-operations';
1213

1314
jest.mock('execa');
1415
const execaMock: jest.Mock = execa as any;
@@ -241,4 +242,15 @@ describe('didPackageChange', () => {
241242
).rejects.toThrow(/no corresponding tag/u);
242243
expect(execaMock).not.toHaveBeenCalled();
243244
});
245+
246+
it('throws if metadata is empty', async () => {
247+
await expect(
248+
didPackageChange(PARSED_MOCK_TAGS, {
249+
manifest: {},
250+
dirName: PACKAGES.A.dir,
251+
dirPath: `packages/${PACKAGES.A.dir}`,
252+
} as PackageMetadata),
253+
).rejects.toThrow(/undefined.*vundefined/u);
254+
expect(execaMock).not.toHaveBeenCalled();
255+
});
244256
});

0 commit comments

Comments
 (0)