Skip to content

Commit

Permalink
fix test and await on publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sugarmanz committed Mar 5, 2022
1 parent cf11837 commit 7c4682f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/gradle/__tests__/gradle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe("Gradle Plugin", () => {
const spy = jest.fn();
exec.mockReturnValueOnce(properties).mockImplementation(spy);

await hooks.canary.promise({ bump: Auto.SEMVER.patch, canaryIdentifier: "canary123" });
await hooks.canary.promise({ bump: Auto.SEMVER.patch, canaryIdentifier: "-canary123" });

expect(spy).toHaveBeenCalledWith(expect.stringMatching("gradle"), [
"updateVersion",
Expand Down
7 changes: 4 additions & 3 deletions plugins/gradle/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default class GradleReleasePluginPlugin implements IPlugin {

/** Tap into auto plugin points. */
apply(auto: Auto) {
/** Call gradle publish, if exists, otherwise log warning */
const publish = async () => {
const { publish } = this.properties;

Expand Down Expand Up @@ -242,7 +243,7 @@ export default class GradleReleasePluginPlugin implements IPlugin {
);

auto.hooks.publish.tapPromise(this.name, async () => {
publish();
await publish();

await execPromise("git", [
"push",
Expand Down Expand Up @@ -276,7 +277,7 @@ export default class GradleReleasePluginPlugin implements IPlugin {
false
);

publish();
await publish();

return canaryVersion;
}
Expand Down Expand Up @@ -330,7 +331,7 @@ export default class GradleReleasePluginPlugin implements IPlugin {
false
);

publish();
await publish();

return preReleaseVersions;
}
Expand Down

0 comments on commit 7c4682f

Please sign in to comment.