本文整理汇总了TypeScript中basic/testing.expect函数的典型用法代码示例。如果您正苦于以下问题:TypeScript expect函数的具体用法?TypeScript expect怎么用?TypeScript expect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expect函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('normalizing bad comments', function () {
expect(normalize('')).toEqual('', 'skips empty values');
expect(normalize(' ')).toEqual('', 'shrinks blanks to empty');
expect(normalize('helloWorld')).toEqual('hello world', 'splits on camel humps');
expect(normalize('HTML')).toEqual('h t m l', 'splits on each cap');
expect(normalize('hey')).toEqual('hey', 'keeps all lowers');
expect(normalize('hey nay')).toEqual('hey nay', 'keeps and normalizes spaces');
});
示例2: expect
first => {
expect(leadingCommentsStrippedOutOf(first.self())).toEqual([' this function does a lot of good stuff ']);
}
示例3: withState
return withState(text, defaultCompilerOptions, rule, options, someRandomRuleKey, shared, state => {
expect(insteadEach(rule.toIssues(state, options, shared), simplifyIssue))
.toEqual(insteadEach(drafts, simplifyIssue), 'Specific issues expected.');
})
示例4: it
it('succeeds with an array of valid regexp patterns as strings', function () {
const actual = readClusion(['a', 'b']);
expect(actual.length).toBe(2);
expect(bt.beLuck(actual[0]!).luck.source).toBe('a');
expect(bt.beLuck(actual[1]!).luck.source).toBe('b');
});
示例5: betterBeLucky
betterBeLucky(parsed, parsed => {
expect(parsed.fullArgs).toEqual(args, 'Unexpected full args.');
});