@@ -14,7 +14,7 @@ import {
1414 ResponseOptions ,
1515} from '@angular/http' ;
1616import { MockBackend } from '@angular/http/testing' ;
17- < % _ if ( filters . expect ) { - % >
17+ < % _ if ( filters . mocha && filters . expect ) { - % >
1818import { expect } from 'chai' ; < % } % > < % if ( filters . uibootstrap ) { % >
1919import { TooltipModule } from 'ngx-bootstrap' ; < % } % >
2020import { FormsModule } from '@angular/forms' ;
@@ -49,15 +49,15 @@ describe('Component: MainComponent', function() {
4949 } ) . compileComponents ( ) ;
5050 } ) ) ;
5151 < % _ if ( filters . ws ) { % >
52- beforeEach('mock backend', async(inject([MockBackend], (mockBackend) => {
52+ beforeEach(async(inject([MockBackend], (mockBackend) => {
5353 mockBackend . connections . subscribe ( conn => {
5454 conn . mockRespond ( new Response ( new ResponseOptions ( {
5555 body : JSON . stringify ( [ 'HTML5 Boilerplate' , 'AngularJS' , 'Karma' , 'Express' ] )
5656 } ) ) ) ;
5757 } ) ;
5858 } )));< % } % >
5959
60- beforeEach('ngOnInit', async(() => {
60+ beforeEach(async(() => {
6161 fixture = TestBed . createComponent ( MainComponent ) ;
6262 // MainComponent test instance
6363 comp = fixture . componentInstance ;
@@ -68,7 +68,8 @@ describe('Component: MainComponent', function() {
6868 fixture . detectChanges ( ) ;
6969 } ));
7070
71- it('should attach a list of things to the controller', () => {
72- expect ( comp . awesomeThings . length ) . to . equal ( 4 ) ;
71+ it('should attach a list of things to the controller', () => { < % if ( filters . jasmine ) { % >
72+ expect ( comp . awesomeThings . length ) . toEqual ( 4 ) ; < % } else if(filters.mocha) { - % >
73+ < %= expect ( ) % > comp . awesomeThings . length < %= to ( ) % > . equal ( 4 ) ; < % } %>
7374 } ) ;
7475} ) ;
0 commit comments