From 70c8c58be20a386691ef19d9e2c570735e6f69a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=A9=E6=95=A3=E6=80=A7=E7=99=BE=E4=B8=87=E7=94=9C?= =?UTF-8?q?=E9=9D=A2=E5=8C=85?= Date: Fri, 17 Apr 2020 20:58:38 +0800 Subject: [PATCH] test(compiler-core): expect onError to be called (#976) --- packages/compiler-core/__tests__/parse.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts index d556a107..f556f5bc 100644 --- a/packages/compiler-core/__tests__/parse.spec.ts +++ b/packages/compiler-core/__tests__/parse.spec.ts @@ -30,11 +30,13 @@ describe('compiler: parse', () => { }) test('simple text with invalid end tag', () => { + const onError = jest.fn() const ast = baseParse('some text', { - onError: () => {} + onError }) const text = ast.children[0] as TextNode + expect(onError).toBeCalled() expect(text).toStrictEqual({ type: NodeTypes.TEXT, content: 'some text',