test: improve coverage

This commit is contained in:
Evan You
2019-09-24 16:35:01 -04:00
parent e67084e5a1
commit cae03f616d
8 changed files with 318 additions and 52 deletions

View File

@@ -85,6 +85,7 @@ function createTransformContext(
childIndex: 0,
currentNode: null,
replaceNode(node) {
/* istanbul ignore if */
if (__DEV__ && !context.currentNode) {
throw new Error(`node being replaced is already removed.`)
}
@@ -97,6 +98,7 @@ function createTransformContext(
: context.currentNode
? context.childIndex
: -1
/* istanbul ignore if */
if (__DEV__ && removalIndex < 0) {
throw new Error(`node being removed is not a child of current parent`)
}