mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 12:15:34 -06:00
Add tests and baselines
This commit is contained in:
parent
cabe4d3606
commit
4f791040fc
24
tests/baselines/reference/checkJsdocTypedefInParamTag1.js
Normal file
24
tests/baselines/reference/checkJsdocTypedefInParamTag1.js
Normal file
@ -0,0 +1,24 @@
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {Object} Opts
|
||||
* @property {string} x
|
||||
* @property {string=} y
|
||||
*
|
||||
* @param {Opts} opts
|
||||
*/
|
||||
function foo(opts) {}
|
||||
|
||||
foo({x: 'abc'});
|
||||
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {Object} Opts
|
||||
* @property {string} x
|
||||
* @property {string=} y
|
||||
*
|
||||
* @param {Opts} opts
|
||||
*/
|
||||
function foo(opts) { }
|
||||
foo({ x: 'abc' });
|
||||
@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {Object} Opts
|
||||
* @property {string} x
|
||||
* @property {string=} y
|
||||
*
|
||||
* @param {Opts} opts
|
||||
*/
|
||||
function foo(opts) {}
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
>opts : Symbol(opts, Decl(0.js, 8, 13))
|
||||
|
||||
foo({x: 'abc'});
|
||||
>foo : Symbol(foo, Decl(0.js, 0, 0))
|
||||
>x : Symbol(x, Decl(0.js, 10, 5))
|
||||
|
||||
20
tests/baselines/reference/checkJsdocTypedefInParamTag1.types
Normal file
20
tests/baselines/reference/checkJsdocTypedefInParamTag1.types
Normal file
@ -0,0 +1,20 @@
|
||||
=== tests/cases/conformance/jsdoc/0.js ===
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {Object} Opts
|
||||
* @property {string} x
|
||||
* @property {string=} y
|
||||
*
|
||||
* @param {Opts} opts
|
||||
*/
|
||||
function foo(opts) {}
|
||||
>foo : (opts: { x: string; y?: string; }) => void
|
||||
>opts : { x: string; y?: string; }
|
||||
|
||||
foo({x: 'abc'});
|
||||
>foo({x: 'abc'}) : void
|
||||
>foo : (opts: { x: string; y?: string; }) => void
|
||||
>{x: 'abc'} : { x: string; }
|
||||
>x : string
|
||||
>'abc' : "abc"
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
// @allowJS: true
|
||||
// @suppressOutputPathCheck: true
|
||||
|
||||
// @filename: 0.js
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {Object} Opts
|
||||
* @property {string} x
|
||||
* @property {string=} y
|
||||
*
|
||||
* @param {Opts} opts
|
||||
*/
|
||||
function foo(opts) {}
|
||||
|
||||
foo({x: 'abc'});
|
||||
Loading…
x
Reference in New Issue
Block a user