Add tests and baselines

This commit is contained in:
Yui T 2017-05-25 20:16:52 -07:00
parent cabe4d3606
commit 4f791040fc
4 changed files with 76 additions and 0 deletions

View 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' });

View File

@ -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))

View 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"

View File

@ -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'});