From 6bb778bef3b201976d95e53f25f49c67fae07136 Mon Sep 17 00:00:00 2001 From: David Vegh Date: Fri, 8 Nov 2024 16:35:18 +0100 Subject: [PATCH] Fix tutorial test with different cwd --- test/e2e/tests/docs/tutorial.mjs | 2 +- test/e2e/tests/docs/tutorial/events.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/tests/docs/tutorial.mjs b/test/e2e/tests/docs/tutorial.mjs index 309c02c67..b652737ba 100644 --- a/test/e2e/tests/docs/tutorial.mjs +++ b/test/e2e/tests/docs/tutorial.mjs @@ -8,7 +8,7 @@ async function getTestSteps(dataFile, configName) { const animations = ( await loadAnimations( config.default, - `./docs/tutorial/${configName}`, + `${import.meta.url.replace('file://', '').replace('/tutorial.mjs', '')}/../../../../docs/tutorial/${configName}`, `../../../../../../docs/tutorial/${configName}` ) ).map((obj) => obj.anims) diff --git a/test/e2e/tests/docs/tutorial/events.mjs b/test/e2e/tests/docs/tutorial/events.mjs index f0e6221bd..d73fb247d 100644 --- a/test/e2e/tests/docs/tutorial/events.mjs +++ b/test/e2e/tests/docs/tutorial/events.mjs @@ -6,7 +6,7 @@ async function getTestSteps(dataFile, configName) { const [data, config] = await Promise.all([dataLoaded, configLoaded]) const baseUrl = { - nodeBaseUrl: `./docs/tutorial/${configName}`, + nodeBaseUrl: `${import.meta.url.replace('file://', '').replace('/events.mjs', '')}/../../../../../docs/tutorial/${configName}`, browserBaseUrl: `../../../../../docs/tutorial/${configName}` }