本文整理匯總了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.');
});