Skip to content

Commit

Permalink
add test for class that extend assignment expression
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Apr 8, 2015
1 parent ed8434b commit 8b7a79f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/dox.test.js
Expand Up @@ -244,7 +244,7 @@ module.exports = {
var comments = dox.parseComments(str)

comments.should.be.an.instanceOf(Array);
comments.should.have.lengthOf(11);
comments.should.have.lengthOf(12);

// class, extends and is exported as default
comments[0].description.full.should.equal('<p>A Foo.</p>');
Expand Down Expand Up @@ -348,6 +348,16 @@ module.exports = {
comments[10].line.should.equal(80);
comments[10].codeStart.should.equal(83);

// class extended by assigment expression
comments[11].description.full.should.equal('');
comments[11].ctx.type.should.be.equal('class');
comments[11].ctx.name.should.be.equal('Ipsum');
comments[11].ctx.constructor.should.be.equal('Ipsum');
comments[11].ctx.extends.should.be.equal('mixin(Foo.Bar, Baz)');
comments[11].ctx.string.should.be.equal('new Ipsum()');
comments[11].line.should.equal(89);
comments[11].codeStart.should.equal(92);

done();
});
},
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/classes.js
Expand Up @@ -85,3 +85,12 @@ class Lorem {
this.options = options
}
}

/*
* @class Lorem
*/
class Ipsum extends mixin(Foo.Bar, Baz) {
constructor(options) {
this.options = options
}
}

0 comments on commit 8b7a79f

Please sign in to comment.