Comparing version 4.0.1 to 4.0.2
@@ -16,4 +16,3 @@ 'use strict' | ||
if (err) return Promise.reject(err) | ||
if (this.options.cache) { | ||
if (this.options.cache && !this.options.source) { | ||
return this.readCache().catch(this._runJsdoc.bind(this)) | ||
@@ -20,0 +19,0 @@ } else { |
{ | ||
"name": "jsdoc-api", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A programmatic interface for jsdoc", | ||
"repository": "https://github.com/jsdoc2md/jsdoc-api.git", | ||
"license": "MIT", | ||
"main": "lib/jsdoc-api", | ||
"keywords": [ | ||
@@ -10,0 +9,0 @@ "jsdoc", |
@@ -45,1 +45,24 @@ 'use strict' | ||
}) | ||
runner.test('caching: .explain({ source, cache: true }) - Ensure correct output (#147)', function () { | ||
return jsdoc.cache.clear().then(() => { | ||
let one = jsdoc.explain({ source: '/**\n * Function one\n */\nfunction one () {}\n', cache: true }) | ||
let two = jsdoc.explain({ source: '/**\n * Function two\n */\nfunction two () {}\n', cache: true }) | ||
let three = jsdoc.explain({ source: '/**\n * Function three\n */\nfunction three () {}\n', cache: true }) | ||
Promise.all([ one, two, three ]).then(output => { | ||
a.strictEqual(output[0][0].description, 'Function one') | ||
a.strictEqual(output[1][0].description, 'Function two') | ||
a.strictEqual(output[2][0].description, 'Function three') | ||
}) | ||
/* ensure it works correctly the second time */ | ||
one = jsdoc.explain({ source: '/**\n * Function one\n */\nfunction one () {}\n', cache: true }) | ||
two = jsdoc.explain({ source: '/**\n * Function two\n */\nfunction two () {}\n', cache: true }) | ||
three = jsdoc.explain({ source: '/**\n * Function three\n */\nfunction three () {}\n', cache: true }) | ||
Promise.all([ one, two, three ]).then(output => { | ||
a.strictEqual(output[0][0].description, 'Function one') | ||
a.strictEqual(output[1][0].description, 'Function two') | ||
a.strictEqual(output[2][0].description, 'Function three') | ||
}) | ||
}) | ||
}) |
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
1073016
51
1513