本文整理汇总了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));