From 0220eb37644fdd0bfb5475bddedd2f019f9efe6d Mon Sep 17 00:00:00 2001 From: Jimver Date: Sun, 1 Jun 2025 17:27:03 +0200 Subject: [PATCH] Correct error instantiation --- __tests__/links/get-links.test.ts | 2 +- __tests__/version.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/links/get-links.test.ts b/__tests__/links/get-links.test.ts index 07006fd..ec650f9 100644 --- a/__tests__/links/get-links.test.ts +++ b/__tests__/links/get-links.test.ts @@ -9,7 +9,7 @@ test.concurrent('getLinks gives a valid ILinks class', async () => { links instanceof LinuxLinks || links instanceof WindowsLinks ).toBeTruthy() } catch (error) { - throw new Error(error) + throw new Error(`Error getting links: ${error}`) // Other OS } }) diff --git a/__tests__/version.test.ts b/__tests__/version.test.ts index a69ece4..803989f 100644 --- a/__tests__/version.test.ts +++ b/__tests__/version.test.ts @@ -11,7 +11,7 @@ test.concurrent.each(['local', 'network'])( expect(version).toBeInstanceOf(SemVer) expect(version.compare(new SemVer(versionString))).toBe(0) } catch (error) { - throw new Error(error) + throw new Error(`Error parsing version: ${error}`) // Other OS } } @@ -37,7 +37,7 @@ test.concurrent.each(['local', 'network'])( `Version not available: ${versionString}` ) } catch (error) { - throw new Error(error) + throw new Error(`Error checking version availability: ${error}`) // Other OS } }