Comparing version 0.4.1 to 0.5.0
@@ -0,1 +1,5 @@ | ||
0.5.0 / 2017-07-17 | ||
================== | ||
* chore: upgrade to latest esprima and lodash | ||
0.4.1 / 2015-12-07 | ||
@@ -2,0 +6,0 @@ ================== |
var parse = require('./parse'); | ||
var trimEachLine = require('./trimEachLine'); | ||
var _ = require('underscore'); | ||
var _ = require('lodash'); | ||
'use strict'; | ||
var transforms = []; | ||
@@ -8,0 +6,0 @@ var outputProcessors = []; |
@@ -1,2 +0,2 @@ | ||
var _ = require('underscore'); | ||
var _ = require('lodash'); | ||
var esprima = require('esprima'); | ||
@@ -11,3 +11,3 @@ var marked = require('marked'); | ||
var tree = esprima.parse(contents, { attachComment: true }); | ||
var tree = esprima.parse(contents, { attachComment: true, range: true }); | ||
@@ -20,25 +20,23 @@ var visitorFactory = function() { | ||
ret.visit = function(node, parent, context) { | ||
if (node.type === 'CallExpression' && | ||
node.callee && | ||
node.callee.name === 'describe' && | ||
node.arguments && | ||
node.arguments.length) { | ||
if (node.type === 'ExpressionStatement' && | ||
_.get(node, 'expression.type') === 'CallExpression' && | ||
_.get(node, 'expression.callee.name') === 'describe' && | ||
_.get(node, 'expression.arguments.length', 0) > 0) { | ||
var block = { | ||
type: 'describe', | ||
contents: node.arguments[0].value, | ||
contents: node.expression.arguments[0].value, | ||
blocks: [], | ||
comments: _.pluck(node.callee.leadingComments || [], 'value') | ||
comments: _.map(node.leadingComments || [], 'value') | ||
}; | ||
context.push(block); | ||
return block.blocks; | ||
} else if (node.type === 'CallExpression' && | ||
node.callee && | ||
node.callee.name === 'it' && | ||
node.arguments && | ||
node.arguments.length) { | ||
} else if (node.type === 'ExpressionStatement' && | ||
_.get(node, 'expression.type') === 'CallExpression' && | ||
_.get(node, 'expression.callee.name') === 'it' && | ||
_.get(node, 'expression.arguments.length', 0) > 1) { | ||
var block = { | ||
type: 'it', | ||
contents: node.arguments[0].value, | ||
comments: _.pluck(node.callee.leadingComments || [], 'value'), | ||
code: contents.substring(node.arguments[1].body.range[0] + 1, node.arguments[1].body.range[1] - 1) | ||
contents: node.expression.arguments[0].value, | ||
comments: _.map(node.leadingComments || [], 'value'), | ||
code: contents.substring(node.expression.arguments[1].body.range[0] + 1, node.expression.arguments[1].body.range[1] - 1) | ||
}; | ||
@@ -45,0 +43,0 @@ |
{ | ||
"name": "acquit", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Parse BDD-style tests (Mocha, Jasmine) to generate documentation", | ||
@@ -20,5 +20,5 @@ "main": "index.js", | ||
"commander": "2.5.0", | ||
"esprima": "https://github.com/ariya/esprima/archive/85fc2f4b6ad109a86d80d9821f52b5b38d0105c0.tar.gz", | ||
"marked": "0.3.5", | ||
"underscore": "1.5.2" | ||
"esprima": "4.0.0", | ||
"lodash": "4.17.4", | ||
"marked": "0.3.5" | ||
}, | ||
@@ -35,3 +35,3 @@ "jscsConfig": { | ||
"gulp-mocha": "2.0.0", | ||
"istanbul": "0.3.5", | ||
"istanbul": "0.4.2", | ||
"jscs": "1.9.0", | ||
@@ -38,0 +38,0 @@ "mocha": "2.0.1" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
33975
0
404
+ Addedlodash@4.17.4
+ Addedesprima@4.0.0(transitive)
+ Addedlodash@4.17.4(transitive)
- Removedunderscore@1.5.2
- Removedunderscore@1.5.2(transitive)
Updatedesprima@4.0.0