Skip to content

Commit

Permalink
fix(utils): add missing extractionBody
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Aug 24, 2019
1 parent 331e160 commit 3bca03e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/comment-to-assert/src/ast-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export function tryGetCodeFromComments(comments) {
return matchResult[1];
}
}
function extractionBody(ast) {
return ast.body[0];
}
export function wrapAssert(actualNode, expectedNode) {
assert(typeof expectedNode !== "undefined");
var type = expectedNode.type || extractionBody(expectedNode).type;
Expand Down
1 change: 1 addition & 0 deletions packages/comment-to-assert/src/comment-to-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function toAssertFromSource(code, filePath) {
var output = source.transform(toAssertFromAST).output();
return output.codeWithMap;
}

/**
* transform AST to asserted AST.
* @param {ESTree.Node} ast
Expand Down

0 comments on commit 3bca03e

Please sign in to comment.