Skip to content

Commit 4f79104

Browse files
author
Yui T
committed
Add tests and baselines
1 parent cabe4d3 commit 4f79104

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//// [0.js]
2+
// @ts-check
3+
/**
4+
* @typedef {Object} Opts
5+
* @property {string} x
6+
* @property {string=} y
7+
*
8+
* @param {Opts} opts
9+
*/
10+
function foo(opts) {}
11+
12+
foo({x: 'abc'});
13+
14+
//// [0.js]
15+
// @ts-check
16+
/**
17+
* @typedef {Object} Opts
18+
* @property {string} x
19+
* @property {string=} y
20+
*
21+
* @param {Opts} opts
22+
*/
23+
function foo(opts) { }
24+
foo({ x: 'abc' });
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== tests/cases/conformance/jsdoc/0.js ===
2+
// @ts-check
3+
/**
4+
* @typedef {Object} Opts
5+
* @property {string} x
6+
* @property {string=} y
7+
*
8+
* @param {Opts} opts
9+
*/
10+
function foo(opts) {}
11+
>foo : Symbol(foo, Decl(0.js, 0, 0))
12+
>opts : Symbol(opts, Decl(0.js, 8, 13))
13+
14+
foo({x: 'abc'});
15+
>foo : Symbol(foo, Decl(0.js, 0, 0))
16+
>x : Symbol(x, Decl(0.js, 10, 5))
17+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/conformance/jsdoc/0.js ===
2+
// @ts-check
3+
/**
4+
* @typedef {Object} Opts
5+
* @property {string} x
6+
* @property {string=} y
7+
*
8+
* @param {Opts} opts
9+
*/
10+
function foo(opts) {}
11+
>foo : (opts: { x: string; y?: string; }) => void
12+
>opts : { x: string; y?: string; }
13+
14+
foo({x: 'abc'});
15+
>foo({x: 'abc'}) : void
16+
>foo : (opts: { x: string; y?: string; }) => void
17+
>{x: 'abc'} : { x: string; }
18+
>x : string
19+
>'abc' : "abc"
20+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @allowJS: true
2+
// @suppressOutputPathCheck: true
3+
4+
// @filename: 0.js
5+
// @ts-check
6+
/**
7+
* @typedef {Object} Opts
8+
* @property {string} x
9+
* @property {string=} y
10+
*
11+
* @param {Opts} opts
12+
*/
13+
function foo(opts) {}
14+
15+
foo({x: 'abc'});

0 commit comments

Comments
 (0)