Botanique/src/tests/utils/regex.test.ts
Mylloon 2cc6c0bd74
Some checks failed
Publish latest version / build (push) Failing after 1m15s
chore: merge dev to main (#181)
- close #100 - find timezone based on locale
- Add tests
- Add tests to CI
- Close #182
- Close #183

Reviewed-on: #181
Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Co-committed-by: Mylloon <kennel.anri@tutanota.com>
2024-09-27 20:49:36 +02:00

26 lines
730 B
TypeScript

import { RegexC, RegExpFlags } from "../../utils/regex";
describe("Regex flags", () => {
test("One parameter", () => {
const regex = RegexC("", RegExpFlags.Global);
expect(regex.global).toBeTruthy();
});
test("All parameters", () => {
const regex = RegexC(
"",
RegExpFlags.Global |
RegExpFlags.MultiLine |
RegExpFlags.Insensitive |
RegExpFlags.Sticky |
RegExpFlags.Unicode |
RegExpFlags.SingleLine,
);
expect(regex.global).toBeTruthy();
expect(regex.multiline).toBeTruthy();
expect(regex.ignoreCase).toBeTruthy();
expect(regex.sticky).toBeTruthy();
expect(regex.unicode).toBeTruthy();
expect(regex.dotAll).toBeTruthy();
});
});