Comparing version 1.0.3 to 1.0.4
@@ -51,3 +51,5 @@ 'use strict'; | ||
}).catch(function (err) { | ||
return _this2.emit('error', err); | ||
process.nextTick(function () { | ||
_this2.emit('error', err); | ||
}); | ||
}); | ||
@@ -54,0 +56,0 @@ this.inProgress = true; |
@@ -33,3 +33,8 @@ 'use strict' | ||
}) | ||
.catch(err => this.emit('error', err)) | ||
.catch(err => { | ||
/* emit the error on the next tick to prevent it crashing the rejection handler */ | ||
process.nextTick(() => { | ||
this.emit('error', err) | ||
}) | ||
}) | ||
this.inProgress = true | ||
@@ -36,0 +41,0 @@ } |
{ | ||
"name": "jsdoc-api", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A programmatic interface for jsdoc", | ||
@@ -30,3 +30,3 @@ "repository": "https://github.com/jsdoc2md/jsdoc-api.git", | ||
"jsdoc-to-markdown": "^1.3.1", | ||
"jsdoc2md-testbed": "~0.0.2", | ||
"jsdoc2md-testbed": "0.0.7", | ||
"rimraf": "^2.4.4", | ||
@@ -33,0 +33,0 @@ "tape": "^4.2.2" |
@@ -75,4 +75,4 @@ var test = require('tape') | ||
t.plan(1) | ||
var input = path.resolve(__dirname, '..', 'node_modules', 'jsdoc2md-testbed', 'build', 'input/buggy/bad-syntax.js') | ||
jsdoc.createExplainStream({ files: input }) | ||
var f = new Fixture('input/buggy', 'bad-syntax.js') | ||
jsdoc.createExplainStream({ files: f.sourcePath }) | ||
.on('error', function (err) { | ||
@@ -85,1 +85,13 @@ t.strictEqual(err.name, 'JSDOC_ERROR') | ||
}) | ||
test('.createExplainStream: handles jsdoc crash', function (t) { | ||
t.plan(1) | ||
var f = new Fixture('input/buggy', 'broken-javascript.js') | ||
jsdoc.createExplainStream({ files: f.sourcePath }) | ||
.on('error', function (err) { | ||
t.strictEqual(err.name, 'JSDOC_ERROR') | ||
}) | ||
.pipe(collectJson(function (output) { | ||
t.fail('should not reach here') | ||
})) | ||
}) |
@@ -8,5 +8,5 @@ var path = require('path') | ||
function Fixture (name) { | ||
function Fixture (name, filePath) { | ||
this.folder = path.resolve(__dirname, '..', '..', 'node_modules', 'jsdoc2md-testbed', 'build', name) | ||
this.sourcePath = path.resolve(this.folder, '0-src.js') | ||
this.sourcePath = path.resolve(this.folder, filePath || '0-src.js') | ||
@@ -13,0 +13,0 @@ this.getSource = function () { |
Sorry, the diff of this file is not supported yet
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
1072647
1523