Skip to content

Commit 2ae97cc

Browse files
miniBilllydell
andauthored
Make compatible with upcoming version of Lamdera (#650)
Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
1 parent acbd947 commit 2ae97cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Generate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ ${after}
5353
// variant of the `Test` type. To avoid having to update this regex if a new
5454
// variant is added, newer versions of elm-explorations/test have prefixed all
5555
// variants with `ElmTestVariant__` so we can match just on that.
56+
// `\$?` is for the Lamdera compiler, where definitions sometimes end with a `$`.
57+
// See https://github.com/lamdera/compiler/pull/41#issuecomment-2725158568
5658
const testVariantDefinition =
57-
/^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;
59+
/^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;
5860

5961
const checkDefinition =
6062
/^(var\s+\$author\$project\$Test\$Runner\$Node\$check)\s*=\s*\$author\$project\$Test\$Runner\$Node\$checkHelperReplaceMe___;?$/m;

0 commit comments

Comments
 (0)