mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
fireProcessingComplete cleanup
This commit is contained in:
parent
0f79895be2
commit
11be32b325
2
jsdoc.js
2
jsdoc.js
@ -237,7 +237,7 @@ function main() {
|
||||
jsdoc.augment.addInherited(docs);
|
||||
jsdoc.borrow.resolveBorrows(docs);
|
||||
|
||||
app.jsdoc.parser.fireProcessingComplete({doclets: docs});
|
||||
app.jsdoc.parser.fireProcessingComplete(docs);
|
||||
|
||||
if (env.opts.explain) {
|
||||
dump(docs);
|
||||
|
||||
@ -98,7 +98,7 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) {
|
||||
};
|
||||
|
||||
exports.Parser.prototype.fireProcessingComplete = function(doclets) {
|
||||
this.emit('processingComplete', doclets);
|
||||
this.emit('processingComplete', { doclets: doclets });
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -80,10 +80,12 @@ describe("jsdoc/src/parser", function() {
|
||||
|
||||
it("should fire processingComplete when fireProcessingComplete is called", function() {
|
||||
var spy = jasmine.createSpy(),
|
||||
doclets = {doclets: ['a','b']};
|
||||
doclets = ['a','b'];
|
||||
parser.on('processingComplete', spy).fireProcessingComplete(doclets);
|
||||
expect(spy).toHaveBeenCalled();
|
||||
expect(spy.mostRecentCall.args[0]).toEqual(doclets);
|
||||
expect(typeof spy.mostRecentCall.args[0]).toBe('object');
|
||||
expect(spy.mostRecentCall.args[0].doclets).toBeDefined();
|
||||
expect(spy.mostRecentCall.args[0].doclets).toBe(doclets);
|
||||
});
|
||||
|
||||
it("should be able to parse its own source file", function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user