本文整理汇总了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');
});
开发者ID:aleksey-bykov,项目名称:rules,代码行数:8,代码来源:rule-spec.ts
示例2: expect
first => {
expect(leadingCommentsStrippedOutOf(first.self())).toEqual([' this function does a lot of good stuff ']);
}
开发者ID:aleksey-bykov,项目名称:rules,代码行数:3,代码来源:rule-spec.ts
示例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.');
})
开发者ID:aleksey-bykov,项目名称:linting,代码行数:4,代码来源:asserting.ts
示例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');
});
开发者ID:aleksey-bykov,项目名称:linting,代码行数:6,代码来源:file-filter-spec.ts
示例5: betterBeLucky
betterBeLucky(parsed, parsed => {
expect(parsed.fullArgs).toEqual(args, 'Unexpected full args.');
});
开发者ID:aleksey-bykov,项目名称:commandlining,代码行数:3,代码来源:loosely-parsed-assertions.ts
注:本文中的basic/testing.expect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论