Skip to content

Accept RegExp needles in toContainText#174

Merged
gaojude merged 1 commit into
mainfrom
jude/to-contain-text-regex
Jul 17, 2026
Merged

Accept RegExp needles in toContainText#174
gaojude merged 1 commit into
mainfrom
jude/to-contain-text-regex

Conversation

@gaojude

@gaojude gaojude commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

toContainText needles can now be a RegExp as well as an exact substring, so /getserversideprops/i catches any casing and an escaped-form pattern can match through the JSONL encoding. Global and sticky flags are stripped before matching so a reused g regex cannot skip matches via lastIndex, and a pattern that matches the empty string throws, since it would make the assertion vacuous under .not.

@gaojude
gaojude marked this pull request as ready for review July 17, 2026 19:38
@gaojude
gaojude merged commit 21419b2 into main Jul 17, 2026
4 checks passed
@gaojude
gaojude deleted the jude/to-contain-text-regex branch July 17, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant