Skip to content

Commit

Permalink
add test case from englercj#105 to confirm that it's resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
aidinabedi committed Jun 4, 2020
1 parent fe18a88 commit 84c1750
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/expected/private_all.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates a new animal.
*/
declare class Animal {
/**
* Move the animal to the specified location.
* @param x - X-coordinate.
* @param y - Y-coordinate.
*/
move(x: number, y: number): void;
}
45 changes: 45 additions & 0 deletions test/fixtures/private_all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @constructor
* @name Animal
* @classdesc An animal.
* @description Creates a new animal.
*/
function Animal() {
this.x = 0;
this.y = 0;
}

/**
* @function
* @name Animal#move
* @description Move the animal to the specified location.
* @param {Number} x - X-coordinate.
* @param {Number} y - Y-coordinate.
*/
Animal.prototype.move = function (x, y) {
this.x = x;
this.y = y;
}

/**
* @private
* @constructor
* @name Dog
* @extends Animal
* @classdesc A dog.
* @description Creates a new dog.
*/
function Dog() {}

Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;

/**
* @private
* @function
* @name Dog#bark
* @description The dog barks.
*/
Dog.prototype.bark = function () {
console.log('Woof!');
}
7 changes: 7 additions & 0 deletions test/specs/private.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expectJsDoc } from '../lib';

suite('Private Checks', () => {
test('All', () => {
expectJsDoc('private_all');
});
});

0 comments on commit 84c1750

Please sign in to comment.