(name, input, fn)
| 11 | * @param {(e: ExceptResult) => void} fn fn to test |
| 12 | */ |
| 13 | const expectCompiled = (name, input, fn) => { |
| 14 | it(`should compile ${name}`, () => { |
| 15 | const items = typeof input === "string" ? input.split(",") : input; |
| 16 | const regexp = itemsToRegexp(items); |
| 17 | const r = new RegExp(`^${regexp}$`); |
| 18 | for (const item of items) { |
| 19 | expect(item).toMatch(r); |
| 20 | } |
| 21 | fn(expect(regexp)); |
| 22 | }); |
| 23 | }; |
| 24 | |
| 25 | expect.addSnapshotSerializer({ |
| 26 | test() { |
no test coverage detected