Add tests and update baselines

This commit is contained in:
Yui T
2017-05-27 19:11:08 -07:00
parent fe838bab2d
commit 227198fae1
12 changed files with 106 additions and 30 deletions

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 27,
"end": 28,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 27
"end": 28
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 32,
"end": 33,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 32
"end": 33
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 29
"end": 30
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -44,6 +44,6 @@
},
"length": 1,
"pos": 8,
"end": 29
"end": 30
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 18,
"end": 19,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -34,6 +34,6 @@
},
"length": 1,
"pos": 8,
"end": 18
"end": 19
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 32,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -45,7 +45,7 @@
"1": {
"kind": "JSDocParameterTag",
"pos": 34,
"end": 55,
"end": 56,
"atToken": {
"kind": "AtToken",
"pos": 34,
@@ -83,6 +83,6 @@
},
"length": 2,
"pos": 8,
"end": 55
"end": 56
}
}

View File

@@ -6,7 +6,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 29,
"end": 30,
"atToken": {
"kind": "AtToken",
"pos": 8,
@@ -45,7 +45,7 @@
"1": {
"kind": "JSDocParameterTag",
"pos": 30,
"end": 51,
"end": 52,
"atToken": {
"kind": "AtToken",
"pos": 30,
@@ -83,6 +83,6 @@
},
"length": 2,
"pos": 8,
"end": 51
"end": 52
}
}

View File

@@ -82,12 +82,6 @@
"end": 56,
"text": "property"
},
"name": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 57,
@@ -97,6 +91,18 @@
"pos": 58,
"end": 64
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
},
"name": {
"kind": "Identifier",
"pos": 66,
"end": 69,
"text": "age"
}
},
{
@@ -114,12 +120,6 @@
"end": 83,
"text": "property"
},
"name": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 84,
@@ -129,6 +129,18 @@
"pos": 85,
"end": 91
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
},
"name": {
"kind": "Identifier",
"pos": 93,
"end": 97,
"text": "name"
}
}
]

View File

@@ -11,7 +11,18 @@
*/
function foo(opts) {}
foo({x: 'abc'});
foo({x: 'abc'});
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {}
foo1({anotherX: "world"});
//// [0.js]
// @ts-check
@@ -26,3 +37,12 @@ foo({x: 'abc'});
*/
function foo(opts) { }
foo({ x: 'abc' });
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) { }
foo1({ anotherX: "world" });

View File

@@ -17,3 +17,18 @@ foo({x: 'abc'});
>foo : Symbol(foo, Decl(0.js, 0, 0))
>x : Symbol(x, Decl(0.js, 12, 5))
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {}
>foo1 : Symbol(foo1, Decl(0.js, 12, 16))
>opts : Symbol(opts, Decl(0.js, 21, 14))
foo1({anotherX: "world"});
>foo1 : Symbol(foo1, Decl(0.js, 12, 16))
>anotherX : Symbol(anotherX, Decl(0.js, 23, 6))

View File

@@ -20,3 +20,21 @@ foo({x: 'abc'});
>x : string
>'abc' : "abc"
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {}
>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void
>opts : { anotherX: string; anotherY?: string; }
foo1({anotherX: "world"});
>foo1({anotherX: "world"}) : void
>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void
>{anotherX: "world"} : { anotherX: string; }
>anotherX : string
>"world" : "world"

View File

@@ -14,4 +14,15 @@
*/
function foo(opts) {}
foo({x: 'abc'});
foo({x: 'abc'});
/**
* @typedef {Object} AnotherOpts
* @property anotherX {string}
* @property anotherY {string=}
*
* @param {AnotherOpts} opts
*/
function foo1(opts) {}
foo1({anotherX: "world"});