Skip to content

Commit 00ddb7b

Browse files
feat: add test
1 parent e90c183 commit 00ddb7b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

__test__/main.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { isGolangciLintV1 } from "../src/main"
2+
3+
describe('isV1', () => {
4+
it('should return false if the version is latest', () => {
5+
expect(isGolangciLintV1("latest")).toBe(false);
6+
})
7+
8+
it('should return true if the version is v1.x.x', () => {
9+
expect(isGolangciLintV1("v1.0.0")).toBe(true);
10+
})
11+
12+
it('should return true if the version is v2.x.x', () => {
13+
expect(isGolangciLintV1("v2.0.0")).toBe(false);
14+
})
15+
});

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async function run(): Promise<void> {
136136
}
137137
}
138138

139-
function isGolangciLintV1(version: string): boolean {
139+
export function isGolangciLintV1(version: string): boolean {
140140
if (version === "latest") {
141141
return false;
142142
}

0 commit comments

Comments
 (0)