From 84c1750c329d0a56a3973c49c6dd3d33247bad79 Mon Sep 17 00:00:00 2001 From: aidinabedi Date: Thu, 4 Jun 2020 07:04:55 +0200 Subject: [PATCH] add test case from englercj/tsd-jsdoc#105 to confirm that it's resolved --- test/expected/private_all.d.ts | 11 +++++++++ test/fixtures/private_all.js | 45 ++++++++++++++++++++++++++++++++++ test/specs/private.ts | 7 ++++++ 3 files changed, 63 insertions(+) create mode 100644 test/expected/private_all.d.ts create mode 100644 test/fixtures/private_all.js create mode 100644 test/specs/private.ts diff --git a/test/expected/private_all.d.ts b/test/expected/private_all.d.ts new file mode 100644 index 0000000..5c31979 --- /dev/null +++ b/test/expected/private_all.d.ts @@ -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; +} diff --git a/test/fixtures/private_all.js b/test/fixtures/private_all.js new file mode 100644 index 0000000..0fff9e0 --- /dev/null +++ b/test/fixtures/private_all.js @@ -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!'); +} diff --git a/test/specs/private.ts b/test/specs/private.ts new file mode 100644 index 0000000..5a46ba4 --- /dev/null +++ b/test/specs/private.ts @@ -0,0 +1,7 @@ +import { expectJsDoc } from '../lib'; + +suite('Private Checks', () => { + test('All', () => { + expectJsDoc('private_all'); + }); +});