Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correctly document constructors and instance properties of ES2015 cla…
…sses (#1182)
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** @module foo */ | ||
|
||
/** Bar class. */ | ||
class Bar { | ||
/** Construct a Bar. */ | ||
constructor() { | ||
/** bar property */ | ||
this.bar = 0; | ||
} | ||
} | ||
|
||
/** Baz class. */ | ||
export class Baz { | ||
/** Construct a Baz. */ | ||
constructor() { | ||
/** baz property */ | ||
this.baz = 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
describe('module classes', function() { | ||
var docSet = jasmine.getDocSetFromFile('test/fixtures/moduleclasses.js'); | ||
var bar = docSet.getByLongname('module:foo~Bar')[0]; | ||
var barBar = docSet.getByLongname('module:foo~Bar#bar')[0]; | ||
var baz = docSet.getByLongname('module:foo.Baz')[0]; | ||
var bazBaz = docSet.getByLongname('module:foo.Baz#baz')[0]; | ||
|
||
describe('inner classes', function() { | ||
it('should merge the constructor doclet with the class doclet', function() { | ||
expect(bar.description).toBe('Construct a Bar.'); | ||
expect(bar.classdesc).toBe('Bar class.'); | ||
}); | ||
|
||
it('should correctly mark the scope of instance properties', function() { | ||
expect(barBar.scope).toBe('instance'); | ||
}); | ||
}); | ||
|
||
describe('exported classes', function() { | ||
it('should merge the constructor doclet with the class doclet', function() { | ||
expect(baz.description).toBe('Construct a Baz.'); | ||
expect(baz.classdesc).toBe('Baz class.'); | ||
}); | ||
|
||
it('should correctly mark the scope of instance properties', function() { | ||
expect(bazBaz.scope).toBe('instance'); | ||
}); | ||
}); | ||
}); |