Comparing version 0.5.1 to 0.6.0
@@ -0,1 +1,5 @@ | ||
0.6.0 / 2018-01-15 | ||
================== | ||
* fix: only take last comment from each block to avoid esprima pulling incorrect comments | ||
0.5.0 / 2017-07-17 | ||
@@ -2,0 +6,0 @@ ================== |
@@ -27,3 +27,3 @@ var _ = require('lodash'); | ||
blocks: [], | ||
comments: _.map(node.leadingComments || [], 'value') | ||
comments: _.takeRight(_.map(node.leadingComments || [], 'value')) | ||
}; | ||
@@ -39,3 +39,3 @@ context.push(block); | ||
contents: node.expression.arguments[0].value, | ||
comments: _.map(node.leadingComments || [], 'value'), | ||
comments: _.takeRight(_.map(node.leadingComments || [], 'value')), | ||
code: contents.substring(node.expression.arguments[1].body.range[0] + 1, node.expression.arguments[1].body.range[1] - 1) | ||
@@ -42,0 +42,0 @@ }; |
{ | ||
"name": "acquit", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Parse BDD-style tests (Mocha, Jasmine) to generate documentation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,20 @@ var assert = require('assert'); | ||
}); | ||
it('handles trailing comments', function() { | ||
var ret = acquit.parse(` | ||
it('test 1', function() { | ||
assert.equal('A', 'A'); | ||
// Trail comment | ||
}); | ||
/* Header comment */ | ||
it('test 2', function() { | ||
assert.equal('A', 'A'); | ||
}); | ||
`); | ||
assert.equal(ret.length, 2); | ||
assert.equal(ret[1].comments.length, 1); | ||
assert.equal(ret[1].comments[0].trim(), 'Header comment'); | ||
}); | ||
}); |
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
407
3
33614
14