This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using AutoMapper; | |
using CardDisputes.Db.Olap.Contracts; | |
using CardDisputes.Db.Olap.DAL.DataMapping; | |
using CardDisputes.Db.Olap.DAL.DataMapping.Predicates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('BannerComponent', () => { | |
let component: BannerComponent; | |
let fixture: ComponentFixture<BannerComponent>; | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
declarations: [ BannerComponent ] | |
}) | |
.compileComponents(); | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {resetFakeAsyncZone} from './fake_async'; | |
import {TestBed} from './test_bed'; | |
declare var global: any; | |
const _global = <any>(typeof window === 'undefined' ? global : window); | |
// Reset the test providers and the fake async zone before each test. | |
if (_global.beforeEach) { | |
_global.beforeEach(() => { | |
TestBed.resetTestingModule(); | |
resetFakeAsyncZone(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resetTestingModule() { | |
clearOverrides(); | |
this._aotSummaries = []; | |
this._templateOverrides = []; | |
this._compiler = null !; | |
this._moduleOverrides = []; | |
this._componentOverrides = []; | |
this._directiveOverrides = []; | |
this._pipeOverrides = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND) { | |
this._initIfNeeded(); | |
if (token === TestBed) { | |
return this; | |
} | |
const result = this._moduleRef.injector.get(token, UNDEFINED); | |
return result === UNDEFINED ? this._compiler.injector.get(token, notFoundValue) : result; | |
} | |
… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private _initIfNeeded() { | |
if (this._instantiated) { | |
return; | |
} | |
if (!this._moduleFactory) { | |
try { | |
const moduleType = this._createCompilerAndModule(); | |
this._moduleFactory = | |
this._compiler.compileModuleAndAllComponentsSync(moduleType).ngModuleFactory; | |
} catch (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Reconfigures current test suit to prevent angular components compilation after every test run. | |
* Forces angular test bed to re-create zone and all injectable services by directly | |
* changing _instantiated to false after every test run. | |
* Cleanups all the changes and reverts test bed configuration after suite is finished. | |
*/ | |
export const configureTestSuite = () => { | |
const testBedApi: any = getTestBed(); | |
const originReset = TestBed.resetTestingModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('#productions Production wizard bates settings', () => { | |
beforeEach(done => (async () => { | |
TestBed.configureTestingModule({ | |
imports: modules, | |
providers: [defaultGlobalProvidersForTests] | |
}); | |
TestBed.overrideModule(ProductionsModule, overrides); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('#productions Production wizard bates settings', () => { | |
configureTestSuite(); | |
beforeAll(done => (async () => { | |
TestBed.configureTestingModule({ | |
imports: modules, | |
providers: [defaultGlobalProvidersForTests] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
frameworks: [ | |
'parallel', | |
'jasmine' | |
], | |
plugins: [ | |
"karma-jasmine", | |
"karma-chrome-launcher", | |
"karma-junit-reporter", | |
"karma-spec-reporter", |
OlderNewer