зеркало из https://github.com/microsoft/paris.git
Fixed tests
This commit is contained in:
Родитель
504b09ad10
Коммит
757e1f1c31
|
@ -2,6 +2,5 @@
|
|||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/paris.wiki" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -312,7 +312,7 @@ export class ReadonlyRepository<TEntity extends ModelBase, TRawData = any> imple
|
|||
* @returns {Observable<TEntity extends EntityModelBase>}
|
||||
*/
|
||||
static getModelData<TEntity extends ModelBase, TRawData extends any = any>(rawData: TRawData, entity: ModelConfig<TEntity, TRawData>, config: ParisConfig, paris: Paris, options: DataOptions = defaultDataOptions, query?: DataQuery): Observable<TEntity> {
|
||||
let entityIdProperty: string = entity.idProperty || config.entityIdProperty,
|
||||
let entityIdProperty: keyof TRawData = entity.idProperty || config.entityIdProperty,
|
||||
modelData: Index = entity instanceof ModelEntity ? {id: rawData[entityIdProperty]} : {},
|
||||
subModels: Array<Observable<{ [index: string]: ModelBase | Array<ModelBase> }>> = [];
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ describe('Paris main', () => {
|
|||
});
|
||||
|
||||
it('should throw error if repo doesn\'t exist', () => {
|
||||
expect(() => paris.query(String)).to.throw()
|
||||
expect(() => paris.query(<any>String)).to.throw()
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ export class Paris{
|
|||
* @param {{[p: string]: any}} params
|
||||
* @returns {Observable<TEntity extends ModelBase>}
|
||||
*/
|
||||
getItemById<TEntity extends EntityModelBase, TId extends EntityId = string>(entityConstructor:DataEntityConstructor<TEntity>, itemId: TId, options?:DataOptions, params?:{ [index:string]:any }): Observable<TEntity>{
|
||||
getItemById<TEntity extends EntityModelBase<TId>, TId extends EntityId, TTId extends TId>(entityConstructor:DataEntityConstructor<TEntity, any, TId>, itemId: TTId, options?:DataOptions, params?:{ [index:string]:any }): Observable<TEntity>{
|
||||
options = options || defaultDataOptions;
|
||||
|
||||
const repository:Repository<TEntity> = this.getRepository(entityConstructor);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@microsoft/paris",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.1",
|
||||
"description": "Library for the implementation of Domain Driven Design in Angular/TypeScript apps",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Загрузка…
Ссылка в новой задаче