本文整理匯總了TypeScript中base/shared/ModelHelper.generateMap函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript generateMap函數的具體用法?TypeScript generateMap怎麽用?TypeScript generateMap使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了generateMap函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('getStations should be a stations observable and having a Map Immutable response', done => {
const MockStationMap = generateMap(MockStations.list, StationModel);
service.getStations()
.subscribe(result => {
expect(result).to.deep.equal(MockStationMap);
done();
});
});
示例2: it
it('should display 2 forecasts detail components', async () => {
const mockForecasts = [{}, {}];
component.forecasts = generateMap(mockForecasts, ForecastModel).valueSeq();
fixture.detectChanges();
await fixture.whenStable();
const details = de.queryAll(By.css('weather-forecast-detail'));
expect(details).to.have.lengthOf(2);
});
示例3: it
it('should handle forecasts success', () => {
const response = generateMap(MockForecasts.list, ForecastModel);
const action: Action = {
type: ActionTypes.FORECASTS_SUCCESS,
payload: { response }
};
const expectedState = new WeatherModel({
forecasts: response
});
expect(WeatherReducer(undefined, action).toObject()).to.deep.equal(expectedState.toObject());
expect(WeatherReducer(state, action).toObject()).to.deep.equal(expectedState.toObject());
});
示例4: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
MapComponent,
StationMarkerComponent,
StationInfoComponent,
HumidityPipe, PressurePipe, TemperaturePipe],
imports: [
GoogleMapsModule
],
}).compileComponents();
fixture = TestBed.createComponent(MapComponent);
component = fixture.componentInstance;
de = fixture.debugElement;
el = fixture.nativeElement;
component.stations = generateMap([{}, {}], StationModel).toIndexedSeq();
fixture.detectChanges();
});
示例5: generateMap
.map(forecasts => generateMap(forecasts.list, ForecastModel));