From a7e454738747e5d133220335f108f0da6da9b628 Mon Sep 17 00:00:00 2001 From: Maxime Mangel Date: Sun, 5 Nov 2023 17:39:51 +0100 Subject: [PATCH] Support watch mode when working on Main JavaScript tests --- src/Fable.Build/Test/JavaScript.fs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Fable.Build/Test/JavaScript.fs b/src/Fable.Build/Test/JavaScript.fs index e2e2f91183..4f4f46c8f7 100644 --- a/src/Fable.Build/Test/JavaScript.fs +++ b/src/Fable.Build/Test/JavaScript.fs @@ -13,8 +13,6 @@ let private mainTestSourceDir = Path.Resolve("tests", "Js", "Main") let private mainTestProject = Path.Resolve("tests", "Js", "Main", "Fable.Tests.fsproj") -let private mochaCommand = "npx mocha . --reporter dot -t 10000" - let private testReact (isWatch: bool) = let workingDirectoy = Path.Resolve("tests", "React") @@ -52,6 +50,15 @@ let private handleMainTests (isWatch: bool) (noDotnet: bool) = let destinationDir = Path.Resolve("temp", "tests", "JavaScript", folderName) + let mochaCommand = + CmdLine.empty + |> CmdLine.appendRaw "npx" + |> CmdLine.appendRaw "mocha" + |> CmdLine.appendRaw destinationDir + |> CmdLine.appendPrefix "--reporter" "dot" + |> CmdLine.appendPrefix "-t" "10000" + |> CmdLine.toString + Directory.clean destinationDir let fableArgs =