From 58d09286fce05d6fc0eba7d9020d44db4cc7eb17 Mon Sep 17 00:00:00 2001 From: Danko Aleksejevs Date: Fri, 18 Jul 2025 06:07:14 +0300 Subject: [PATCH] Use full file path when file is not inside of basePath --- .../AvaJavaScriptTestRunnerRunConfigurationGenerator.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt b/src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt index fe2080f..a41fa77 100644 --- a/src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt +++ b/src/main/kotlin/no/eirikb/avatest/actions/AvaJavaScriptTestRunnerRunConfigurationGenerator.kt @@ -84,7 +84,11 @@ class AvaJavaScriptTestRunnerRunConfigurationGenerator : AnAction() { val filePath = currentFile.path val fileName = Paths.get(filePath).fileName.toString() val basePath = project.basePath - val relPath = if (basePath == null) fileName else currentFile.path.substring(basePath.length + 1) + val relPath = if (basePath == null || !filePath.startsWith(basePath)) { + filePath + } else { + filePath.substring(basePath.length + 1) + } val configuration = if (AppSettingsState.instance.selectedCommand) { this.createNodeJsRunConfiguration(project, fileName, relPath, testName)