(code: string, shouldAsync = true)
| 877 | |
| 878 | describe('async/await detection', () => { |
| 879 | function assertAwaitDetection(code: string, shouldAsync = true) { |
| 880 | const { content } = compile(`<script setup>${code}</script>`) |
| 881 | if (shouldAsync) { |
| 882 | expect(content).toMatch(`let __temp, __restore`) |
| 883 | } |
| 884 | expect(content).toMatch(`${shouldAsync ? `async ` : ``}setup(`) |
| 885 | assertCode(content) |
| 886 | return content |
| 887 | } |
| 888 | |
| 889 | test('expression statement', () => { |
| 890 | assertAwaitDetection(`await foo`) |
no test coverage detected