From eb4263a99b0bcdcb177ec3322ca55c3d58ffdeb4 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 26 Jun 2024 18:43:28 +0200 Subject: [PATCH 1/3] fix: linter issue --- src/utils/__tests__/version.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/__tests__/version.test.ts b/src/utils/__tests__/version.test.ts index c3922d84..4a6b82f6 100644 --- a/src/utils/__tests__/version.test.ts +++ b/src/utils/__tests__/version.test.ts @@ -183,8 +183,8 @@ describe('versionGreaterOrEqualThan', () => { }); test('can compare pre parts', () => { - const v1 = parseVersion('1.2.3-1')!; - const v2 = parseVersion('1.2.3-2')!; + const v1 = parseVersion('1.2.3-1'); + const v2 = parseVersion('1.2.3-2'); expect(versionGreaterOrEqualThan(v1, v2)).toBe(false); expect(versionGreaterOrEqualThan(v2, v1)).toBe(true); }); From ab11aceefa94abfa7930a31dc636d4dd5c0b818e Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 26 Jun 2024 18:45:55 +0200 Subject: [PATCH 2/3] fixup --- src/utils/__tests__/version.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/__tests__/version.test.ts b/src/utils/__tests__/version.test.ts index 4a6b82f6..7da21319 100644 --- a/src/utils/__tests__/version.test.ts +++ b/src/utils/__tests__/version.test.ts @@ -185,8 +185,10 @@ describe('versionGreaterOrEqualThan', () => { test('can compare pre parts', () => { const v1 = parseVersion('1.2.3-1'); const v2 = parseVersion('1.2.3-2'); - expect(versionGreaterOrEqualThan(v1, v2)).toBe(false); - expect(versionGreaterOrEqualThan(v2, v1)).toBe(true); + expect(v1).not.toBeNull(); + expect(v2).not.toBeNull(); + expect(versionGreaterOrEqualThan(v1 as SemVer, v2 as SemVer)).toBe(false); + expect(versionGreaterOrEqualThan(v2 as SemVer, v1 as SemVer)).toBe(true); }); test('throws an exception if there are build parts', () => { From 8f7a92408dd742fb26b79932f563c21ed1611142 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Fri, 28 Jun 2024 06:52:02 +0200 Subject: [PATCH 3/3] Update src/utils/__tests__/version.test.ts Co-authored-by: Burak Yigit Kaya --- src/utils/__tests__/version.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/__tests__/version.test.ts b/src/utils/__tests__/version.test.ts index 7da21319..95fe7cba 100644 --- a/src/utils/__tests__/version.test.ts +++ b/src/utils/__tests__/version.test.ts @@ -183,12 +183,10 @@ describe('versionGreaterOrEqualThan', () => { }); test('can compare pre parts', () => { - const v1 = parseVersion('1.2.3-1'); - const v2 = parseVersion('1.2.3-2'); - expect(v1).not.toBeNull(); - expect(v2).not.toBeNull(); - expect(versionGreaterOrEqualThan(v1 as SemVer, v2 as SemVer)).toBe(false); - expect(versionGreaterOrEqualThan(v2 as SemVer, v1 as SemVer)).toBe(true); + const v1 = parseVersion('1.2.3-1') as SemVer; + const v2 = parseVersion('1.2.3-2') as SemVer; + expect(versionGreaterOrEqualThan(v1, v2)).toBe(false); + expect(versionGreaterOrEqualThan(v2, v1)).toBe(true); }); test('throws an exception if there are build parts', () => {