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


TypeScript testing_internal.expect函數代碼示例

本文整理匯總了TypeScript中@angular/core/testing/src/testing_internal.expect函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript expect函數的具體用法?TypeScript expect怎麽用?TypeScript expect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了expect函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: expect

 () => { expect(Validators.required(new FormControl(null))).toEqual({'required': true}); });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:1,代碼來源:validators_spec.ts

示例2: it

 it('should return correct value for numbers', () => {
   expect(pipe.transform(1.23)).toEqual('123%');
   expect(pipe.transform(1.2, '.2')).toEqual('120.00%');
   expect(pipe.transform(1.2, '4.2')).toEqual('0,120.00%');
   expect(pipe.transform(1.2, '4.2', 'fr')).toEqual('0 120,00 %');
   // see issue #20136
   expect(pipe.transform(0.12345674, '0.0-10')).toEqual('12.345674%');
   expect(pipe.transform(0, '0.0-10')).toEqual('0%');
   expect(pipe.transform(0.00, '0.0-10')).toEqual('0%');
   expect(pipe.transform(1, '0.0-10')).toEqual('100%');
   expect(pipe.transform(0.1, '0.0-10')).toEqual('10%');
   expect(pipe.transform(0.12, '0.0-10')).toEqual('12%');
   expect(pipe.transform(0.123, '0.0-10')).toEqual('12.3%');
   expect(pipe.transform(12.3456, '0.0-10')).toEqual('1,234.56%');
   expect(pipe.transform(12.345600, '0.0-10')).toEqual('1,234.56%');
   expect(pipe.transform(12.345699999, '0.0-6')).toEqual('1,234.57%');
   expect(pipe.transform(12.345699999, '0.4-6')).toEqual('1,234.5700%');
   expect(pipe.transform(100, '0.4-6')).toEqual('10,000.0000%');
   expect(pipe.transform(100, '0.0-10')).toEqual('10,000%');
   expect(pipe.transform(1.5e2)).toEqual('15,000%');
   expect(pipe.transform(1e100)).toEqual('1E+102%');
 });
開發者ID:asself,項目名稱:angular,代碼行數:22,代碼來源:number_pipe_spec.ts

示例3: it

 it('should calculate the mean', () => {
   expect(Statistic.calculateMean([])).toBeNaN();
   expect(Statistic.calculateMean([1, 2, 3])).toBe(2.0);
 });
開發者ID:BobChao87,項目名稱:angular,代碼行數:4,代碼來源:statistic_spec.ts

示例4: expect

 () => { expect(isNumeric('1e5')).toBe(true); });
開發者ID:asself,項目名稱:angular,代碼行數:1,代碼來源:number_pipe_spec.ts

示例5: it

 it('should fallback to the default PipeResolver when templates are not overridden', () => {
   const pipe = pipeResolver.resolve(SomePipe);
   expect(pipe.name).toEqual('somePipe');
 });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:4,代碼來源:pipe_resolver_mock_spec.ts


注:本文中的@angular/core/testing/src/testing_internal.expect函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。