From a21eaeb93f2a4c67669f8859fca0d38c8ebb407d Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Sun, 6 Jul 2025 13:50:42 +0200 Subject: [PATCH 1/2] Make compatible with upcoming version of Lamdera --- lib/Generate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Generate.js b/lib/Generate.js index f6cad66a..b9bc9c2c 100644 --- a/lib/Generate.js +++ b/lib/Generate.js @@ -54,7 +54,7 @@ ${after} // variant is added, newer versions of elm-explorations/test have prefixed all // variants with `ElmTestVariant__` so we can match just on that. const testVariantDefinition = - /^var\s+\$elm_explorations\$test\$Test\$Internal\$(?:ElmTestVariant__\w+|UnitTest|FuzzTest|Labeled|Skipped|Only|Batch)\s*=\s*(?:\w+\(\s*)?function\s*\([\w, ]*\)\s*\{\s*return *\{/gm; + /^var\s+\$elm_explorations\$test\$Test\$Internal\$(?:ElmTestVariant__\w+|UnitTest|FuzzTest|Labeled|Skipped|Only|Batch)\$?\s*=\s*(?:\w+\(\s*)?function\s*\([\w, ]*\)\s*\{\s*return *\{/gm; const checkDefinition = /^(var\s+\$author\$project\$Test\$Runner\$Node\$check)\s*=\s*\$author\$project\$Test\$Runner\$Node\$checkHelperReplaceMe___;?$/m; From 03f230cccb0da260b85047e85ba7567e9eb16ff0 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 6 Jul 2025 16:55:12 +0200 Subject: [PATCH 2/2] Add comment --- lib/Generate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Generate.js b/lib/Generate.js index b9bc9c2c..6d87e068 100644 --- a/lib/Generate.js +++ b/lib/Generate.js @@ -53,6 +53,8 @@ ${after} // variant of the `Test` type. To avoid having to update this regex if a new // variant is added, newer versions of elm-explorations/test have prefixed all // variants with `ElmTestVariant__` so we can match just on that. +// `\$?` is for the Lamdera compiler, where definitions sometimes end with a `$`. +// See https://github.com/lamdera/compiler/pull/41#issuecomment-2725158568 const testVariantDefinition = /^var\s+\$elm_explorations\$test\$Test\$Internal\$(?:ElmTestVariant__\w+|UnitTest|FuzzTest|Labeled|Skipped|Only|Batch)\$?\s*=\s*(?:\w+\(\s*)?function\s*\([\w, ]*\)\s*\{\s*return *\{/gm;