فهرست منبع

wip: decodeEntities test

Evan You 2 سال پیش
والد
کامیت
fc4f801070
1فایلهای تغییر یافته به همراه6 افزوده شده و 7 حذف شده
  1. 6 7
      packages/compiler-core/__tests__/parse.spec.ts

+ 6 - 7
packages/compiler-core/__tests__/parse.spec.ts

@@ -1813,7 +1813,7 @@ describe('compiler: parse', () => {
   })
   })
 
 
   describe('decodeEntities option', () => {
   describe('decodeEntities option', () => {
-    test.skip('use default map', () => {
+    test('use decode by default', () => {
       const ast: any = baseParse('><&'"&foo;')
       const ast: any = baseParse('><&'"&foo;')
 
 
       expect(ast.children.length).toBe(1)
       expect(ast.children.length).toBe(1)
@@ -1821,15 +1821,14 @@ describe('compiler: parse', () => {
       expect(ast.children[0].content).toBe('><&\'"&foo;')
       expect(ast.children[0].content).toBe('><&\'"&foo;')
     })
     })
 
 
-    test.skip('use the given map', () => {
-      const ast: any = baseParse('&amp;&cups;', {
+    test('should warn in non-browser build', () => {
+      baseParse('&amp;&cups;', {
         decodeEntities: text => text.replace('&cups;', '\u222A\uFE00'),
         decodeEntities: text => text.replace('&cups;', '\u222A\uFE00'),
         onError: () => {} // Ignore errors
         onError: () => {} // Ignore errors
       })
       })
-
-      expect(ast.children.length).toBe(1)
-      expect(ast.children[0].type).toBe(NodeTypes.TEXT)
-      expect(ast.children[0].content).toBe('&amp;\u222A\uFE00')
+      expect(
+        `decodeEntities option is passed but will be ignored`
+      ).toHaveBeenWarned()
     })
     })
   })
   })