Skip to content

Commit 42b8f70

Browse files
committed
Add tests for class methods
1 parent 46acf3f commit 42b8f70

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

tests/cases/conformance/jsdoc/checkJsdocTypeTag6.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ function add3(a, b) { return a + b; }
2626
// They can't have more parameters than the type/context.
2727

2828
/** @type {() => void} */
29-
function func(more) {} // error
29+
function funcWithMoreParameters(more) {} // error
3030

3131
/** @type {() => void} */
32-
const variable = function (more) {}; // error
32+
const variableWithMoreParameters = function (more) {}; // error
3333

3434
/** @type {() => void} */
35-
const arrow = (more) => {}; // error
35+
const arrowWithMoreParameters = (more) => {}; // error
3636

3737
({
3838
/** @type {() => void} */
39-
method(more) {}, // error
39+
methodWithMoreParameters(more) {}, // error
4040

4141
/** @type {() => void} */
42-
prop: function (more) {}, // error
42+
propWithMoreParameters: function (more) {}, // error
4343

4444
/** @type {() => void} */
45-
arrow: (more) => {}, // error
45+
arrowWithMoreParameters: (more) => {}, // error
4646
});

tests/cases/conformance/jsdoc/checkJsdocTypeTag7.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@
1010
class C {
1111
/** @type {Foo} */
1212
foo(a, b) {}
13+
14+
/** @type {(optional?) => void} */
15+
methodWithOptionalParameters() {}
16+
17+
/** @type {(optional?) => void} */
18+
propWithOptionalParameters = function () {};
19+
20+
/** @type {(optional?) => void} */
21+
arrowWithOptionalParameters = () => {};
1322
}

0 commit comments

Comments
 (0)