diff --git a/packages/core/src/__tests__/auto.test.ts b/packages/core/src/__tests__/auto.test.ts index 0fd28aed19..154e6acad5 100644 --- a/packages/core/src/__tests__/auto.test.ts +++ b/packages/core/src/__tests__/auto.test.ts @@ -1469,7 +1469,12 @@ describe("Auto", () => { auto.hooks.afterShipIt.tap("test", afterShipIt); await auto.shipit(); - expect(afterShipIt).not.toHaveBeenCalled(); + expect(afterShipIt).toHaveBeenCalledWith({ + dryRun: undefined, + newVersion: undefined, + context: 'latest', + commitsInRelease: [], + }); }); test("should publish to latest on base branch", async () => { diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts index 68d0973eaa..18ef848b55 100644 --- a/packages/core/src/auto.ts +++ b/packages/core/src/auto.ts @@ -1635,15 +1635,10 @@ export default class Auto { } } - if (!publishInfo) { - return; - } - - const { newVersion, commitsInRelease, context } = publishInfo; await this.hooks.afterShipIt.promise({ - newVersion, - commitsInRelease, - context, + newVersion: publishInfo?.newVersion, + commitsInRelease: publishInfo?.commitsInRelease || [], + context: publishInfo?.context || releaseType, dryRun: args.dryRun, }); }