LeaVerou / htest

Declarative, boilerplate-free unit testing
https://htest.dev/
MIT License
19 stars 3 forks source link

equals should compare regexps by comparing `.source` and `.flags` #48

Open LeaVerou opened 4 months ago

LeaVerou commented 4 months ago

Hm or maybe the default .toString()

LeaVerou commented 4 months ago

So, neither actually. RegExp flags are sorted when reserialized, so we should take that into account when comparing and not fail because of flag ordering.