Closed TylerLeonhardt closed 3 years ago
As long as the verbose doesn't contain a '{', I was wondering how you were going to go about it because it was a headscratcher for me, guess I was overthinking it :)
As long as the verbose doesn't contain a '{',
Remember, Verbose starts with VERBOSE:
So that shouldn't ever be the case unless you literally emit a {
to the pipeline or write-hosting...but at that point... Why are you doing that? 😆
@TylerLeonhardt actually found this regex while working on something else which may be useful to extract it out: https://regex101.com/r/H6PLlc/1
Interesting... It looks like that regex does work for your tests too.
That's probably the better way to go.
https://stackoverflow.com/a/4414453
so JS doesn't support (?R)
that that regex uses... and this seems to be the workaround...
https://blog.stevenlevithan.com/archives/javascript-match-nested
but wow... lots of code. I think I'll hold off on this until I run into someone who breaks my logic today.
I imagine you could do a lot simpler non-recursive regex because you know the output will be in test json format, so you can just match on a few properties to be "good enough". Let me throw one together that should be JS compatible
@TylerLeonhardt here's a simple one, it assumes that there won't be any output after the JSON (which there shouldn't be) https://regex101.com/r/XDymWd/1/
I adopted your regex in the latest version 😃
Now we filter out anything that happens before pester emits the json.
fixes #40