]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(compiler-core): expect onError to be called (#976)
author扩散性百万甜面包 <himself65@outlook.com>
Fri, 17 Apr 2020 12:58:38 +0000 (20:58 +0800)
committerGitHub <noreply@github.com>
Fri, 17 Apr 2020 12:58:38 +0000 (08:58 -0400)
packages/compiler-core/__tests__/parse.spec.ts

index d556a107036d3a853a8e3a13ea3f17bd9e1d3245..f556f5bc90069fa0227fe1170ea369cace2319a1 100644 (file)
@@ -30,11 +30,13 @@ describe('compiler: parse', () => {
     })
 
     test('simple text with invalid end tag', () => {
+      const onError = jest.fn()
       const ast = baseParse('some text</div>', {
-        onError: () => {}
+        onError
       })
       const text = ast.children[0] as TextNode
 
+      expect(onError).toBeCalled()
       expect(text).toStrictEqual({
         type: NodeTypes.TEXT,
         content: 'some text',