Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {renderToStaticMarkup} from "react-dom/server" |
||
2 | |||
3 | type RElement = Parameters<typeof renderToStaticMarkup>[0] |
||
4 | |||
5 | export default expectRender |
||
6 | |||
7 | function expectRender( |
||
8 | ...elements: RElement[] |
||
9 | ) { |
||
10 | return { |
||
11 | toSame: (...expectations: RElement[]) => |
||
12 | expect( |
||
13 | elements.map(renderToStaticMarkup).join("") |
||
14 | ).toBe( |
||
15 | expectations.map(renderToStaticMarkup).join("") |
||
16 | ) |
||
17 | } |
||
18 | } |
||
19 |