本文整理汇总了TypeScript中ng-metadata/testing.IRender类的典型用法代码示例。如果您正苦于以下问题:TypeScript IRender类的具体用法?TypeScript IRender怎么用?TypeScript IRender使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IRender类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe( `AppComponent`, () => {
let render: IRender;
beforeEach( angular.mock.module( AppModule ) );
beforeEach( angular.mock.inject( ( $injector: ng.auto.IInjectorService ) => {
const $compile = $injector.get<ng.ICompileService>( '$compile' );
const $rootScope = $injector.get<ng.IRootScopeService>( '$rootScope' );
const $scope = $rootScope.$new();
render = renderFactory( $compile, $scope );
} ) );
it( `should render Hello Pluto!!!`, () => {
const { ctrl, compiledElement } = render( AppComponent );
expect( ctrl instanceof AppComponent ).toBe( true );
expect( compiledElement.text() ).toContain( 'Hello from Pluto!!!' );
} );
} );
开发者ID:aciccarello,项目名称:Angular1-scaffold,代码行数:26,代码来源:app.component.spec.ts
示例2: describe
describe( `AppComponent`, () => {
@Component( {
selector: 'test-component',
directives: [ AppComponent ],
template: `<my-app></my-app>`
} )
class TestComponent {
}
const TestModule: string = bundle( TestComponent ).name;
let render: IRender<TestComponent>;
beforeEach( angular.mock.module( TestModule ) );
beforeEach( angular.mock.inject( ( $injector: ng.auto.IInjectorService ) => {
const $compile = $injector.get<ng.ICompileService>( '$compile' );
const $rootScope = $injector.get<ng.IRootScopeService>( '$rootScope' );
const $scope = $rootScope.$new();
render = renderFactory( $compile, $scope );
} ) );
it( `should render Hello Pluto!!!`, () => {
const {compiledElement} = render(TestComponent);
// now we need to get our tested component
const { debugElement, componentInstance } = queryByDirective( compiledElement, AppComponent );
expect( componentInstance instanceof AppComponent ).toBe( true );
expect( debugElement.text() ).toContain( 'Hello from Pluto!!!' );
} );
} );
开发者ID:7Kronos,项目名称:Angular1-scaffold,代码行数:39,代码来源:app.component.spec.ts
示例3: it
it( `should render Hello Pluto!!!`, () => {
const { ctrl, compiledElement } = render( AppComponent );
expect( ctrl instanceof AppComponent ).toBe( true );
expect( compiledElement.text() ).toContain( 'Hello from Pluto!!!' );
} );
开发者ID:aciccarello,项目名称:Angular1-scaffold,代码行数:8,代码来源:app.component.spec.ts
示例4: it
it( `should render Hello Pluto!!!`, () => {
const {compiledElement} = render(TestComponent);
// now we need to get our tested component
const { debugElement, componentInstance } = queryByDirective( compiledElement, AppComponent );
expect( componentInstance instanceof AppComponent ).toBe( true );
expect( debugElement.text() ).toContain( 'Hello from Pluto!!!' );
} );
开发者ID:7Kronos,项目名称:Angular1-scaffold,代码行数:11,代码来源:app.component.spec.ts
注:本文中的ng-metadata/testing.IRender类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论