提交 328f6668 编写于 作者: 雪洛's avatar 雪洛

test: 增加type测试例

上级 e078ef0c
......@@ -13,6 +13,23 @@ export function testType() : Result {
age: 2
} as Person
expect(a instanceof Person).toEqual(true);
expect(b instanceof Person).toEqual(true);
})
test("Type with any[]", () => {
type Person = {
age: number,
friends: any[]
}
const a: Person = {
age: 1,
friends: ['b']
}
const b = {
age: 2,
friends: ['a']
} as Person
expect(a instanceof Person).toEqual(true);
expect(b instanceof Person).toEqual(true);
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册