Web Dev Solutions

Catalin Mititiuc

From 163e3a9de59f5d6a8df38fa32a1e7dc4db1ad024 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Sat, 1 Jun 2024 17:50:58 -0700 Subject: Fix/refactor tests --- test/integration/helpers.cjs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/integration/helpers.cjs') diff --git a/test/integration/helpers.cjs b/test/integration/helpers.cjs index 5643bfd..7e3e0fd 100644 --- a/test/integration/helpers.cjs +++ b/test/integration/helpers.cjs @@ -9,3 +9,8 @@ global.takeScreenshot = async (driver) => { await mkdir(dir, { recursive: true }); await writeFile(`${dir}/${fileName.replaceAll('/', '-')}`, image, 'base64'); }; + +global.url = (relativeOrAbsolute) => { + const location = new URL(relativeOrAbsolute, global.testServerUrl); + return location.href; +} -- cgit v1.2.3