當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript testing.expect函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。