소스 검색

more coverage improvements

Evan You 10 년 전
부모
커밋
9c2ca07cc6
3개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/core/util/options.js
  2. 1 0
      src/core/util/props.js
  3. 10 0
      test/unit/modules/compiler/codegen.spec.js

+ 1 - 0
src/core/util/options.js

@@ -162,6 +162,7 @@ config._assetTypes.forEach(function (type) {
  * another, so we merge them as arrays.
  */
 strats.watch = function (parentVal: ?Object, childVal: ?Object): ?Object {
+  /* istanbul ignore if */
   if (!childVal) return parentVal
   if (!parentVal) return childVal
   const ret = {}

+ 1 - 0
src/core/util/props.js

@@ -12,6 +12,7 @@ type PropOptions = {
 }
 
 export function validateProp (vm: Component, key: string, propsData: ?Object): any {
+  /* istanbul ignore if */
   if (!vm.$options.props || !propsData) return
   const prop = vm.$options.props[key]
   const absent = !hasOwn(propsData, key)

+ 10 - 0
test/unit/modules/compiler/codegen.spec.js

@@ -102,6 +102,16 @@ describe('codegen', () => {
     )
   })
 
+  it('generate MathML tag', () => {
+    assertCodegen(
+      `<math>
+        <matrix>
+        </matrix>
+      </math>`,
+      `with(this){return _h(_e('math',void 0,'math'),[_h(_e('matrix',void 0,'math'))])}`
+    )
+  })
+
   it('generate render tag', () => {
     assertCodegen(
       '<render :method="onRender" :args="params"></render>',