Skip to content

Commit 1d46dd7

Browse files
committed
fix: rename plugin name
1 parent 7150100 commit 1d46dd7

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/__tests__/index.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { success, verifyConditions } from '../index';
1+
import { addJiraIssueComment, verifyConditions } from '../index';
22
import { JiraClient } from '../jira-client';
33
import { IssueExtractor } from '../issue-extractor';
44
import { PluginConfig, Context } from '../types';
@@ -9,7 +9,7 @@ jest.mock('../issue-extractor');
99
const MockedJiraClient = JiraClient as jest.MockedClass<typeof JiraClient>;
1010
const MockedIssueExtractor = IssueExtractor as jest.MockedClass<typeof IssueExtractor>;
1111

12-
describe('success', () => {
12+
describe('addJiraIssueComment', () => {
1313
let pluginConfig: PluginConfig;
1414
let context: Context;
1515
let mockLogger: { log: jest.Mock; error: jest.Mock };
@@ -55,7 +55,7 @@ describe('success', () => {
5555
MockedJiraClient.mockImplementation(() => mockJiraClient as any);
5656
MockedIssueExtractor.mockImplementation(() => mockExtractor as any);
5757

58-
await success(pluginConfig, context);
58+
await addJiraIssueComment(pluginConfig, context);
5959

6060
expect(MockedJiraClient).toHaveBeenCalledWith({
6161
host: 'test.atlassian.net',
@@ -84,7 +84,7 @@ describe('success', () => {
8484

8585
pluginConfig.commentTemplate = 'Released {{version}} with tag {{gitTag}}';
8686

87-
await success(pluginConfig, context);
87+
await addJiraIssueComment(pluginConfig, context);
8888

8989
expect(mockJiraClient.addComment).toHaveBeenCalledWith('ABC-123', 'Released 1.0.0 with tag v1.0.0');
9090
});
@@ -94,7 +94,7 @@ describe('success', () => {
9494
delete process.env.JIRA_EMAIL;
9595
delete process.env.JIRA_TOKEN;
9696

97-
await success(pluginConfig, context);
97+
await addJiraIssueComment(pluginConfig, context);
9898

9999
expect(mockLogger.error).toHaveBeenCalledWith('JIRA configuration is missing. Please set JIRA_HOST, JIRA_EMAIL, and JIRA_TOKEN environment variables.');
100100
});
@@ -106,7 +106,7 @@ describe('success', () => {
106106

107107
MockedIssueExtractor.mockImplementation(() => mockExtractor as any);
108108

109-
await success(pluginConfig, context);
109+
await addJiraIssueComment(pluginConfig, context);
110110

111111
expect(mockLogger.log).toHaveBeenCalledWith('No JIRA issues found in commits.');
112112
});
@@ -125,7 +125,7 @@ describe('success', () => {
125125
MockedJiraClient.mockImplementation(() => mockJiraClient as any);
126126
MockedIssueExtractor.mockImplementation(() => mockExtractor as any);
127127

128-
await success(pluginConfig, context);
128+
await addJiraIssueComment(pluginConfig, context);
129129

130130
expect(mockJiraClient.addComment).toHaveBeenCalledWith('ABC-123', 'The issue (ABC-123) was included in version 1.0.0 of my-awesome-package 🎉');
131131
});
@@ -146,7 +146,7 @@ describe('success', () => {
146146

147147
pluginConfig.commentTemplate = '{{packageName}} {{version}} deployed with {{gitTag}} for {{issueKey}}';
148148

149-
await success(pluginConfig, context);
149+
await addJiraIssueComment(pluginConfig, context);
150150

151151
expect(mockJiraClient.addComment).toHaveBeenCalledWith('ABC-123', 'test-package 1.0.0 deployed with v1.0.0 for ABC-123');
152152
});
@@ -163,7 +163,7 @@ describe('success', () => {
163163
MockedJiraClient.mockImplementation(() => mockJiraClient as any);
164164
MockedIssueExtractor.mockImplementation(() => mockExtractor as any);
165165

166-
await success(pluginConfig, context);
166+
await addJiraIssueComment(pluginConfig, context);
167167

168168
expect(mockLogger.error).toHaveBeenCalledWith('Failed to add comment to ABC-123: API Error');
169169
});

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function verifyConditions(pluginConfig: PluginConfig, context: Cont
5757
}
5858
}
5959

60-
export async function success(pluginConfig: PluginConfig, context: Context): Promise<void> {
60+
export async function addJiraIssueComment(pluginConfig: PluginConfig, context: Context): Promise<void> {
6161
const { commentTemplate = DEFAULT_COMMENT_TEMPLATE, issuePattern } = pluginConfig;
6262
const { nextRelease, commits, logger } = context;
6363

@@ -115,4 +115,4 @@ export async function success(pluginConfig: PluginConfig, context: Context): Pro
115115
}
116116

117117
// Export the plugin configuration
118-
export default { verifyConditions, success };
118+
export default { verifyConditions, addJiraIssueComment };

0 commit comments

Comments
 (0)