(
shouldWarn: boolean,
children: RawSlots,
props: SuspenseProps | null = null,
)
| 2811 | describe('warnings', () => { |
| 2812 | // base function to check if a combination of slots warns or not |
| 2813 | function baseCheckWarn( |
| 2814 | shouldWarn: boolean, |
| 2815 | children: RawSlots, |
| 2816 | props: SuspenseProps | null = null, |
| 2817 | ) { |
| 2818 | const Comp = { |
| 2819 | setup() { |
| 2820 | return () => h(Suspense, props, children) |
| 2821 | }, |
| 2822 | } |
| 2823 | |
| 2824 | const root = nodeOps.createElement('div') |
| 2825 | render(h(Comp), root) |
| 2826 | |
| 2827 | if (shouldWarn) { |
| 2828 | expect(`<Suspense> slots expect a single root node.`).toHaveBeenWarned() |
| 2829 | } else { |
| 2830 | expect( |
| 2831 | `<Suspense> slots expect a single root node.`, |
| 2832 | ).not.toHaveBeenWarned() |
| 2833 | } |
| 2834 | } |
| 2835 | |
| 2836 | // actual function that we use in tests |
| 2837 | const checkWarn = baseCheckWarn.bind(null, true) |
nothing calls this directly
no test coverage detected