Sebastian
06/14/2021, 1:27 PMimport { prismaMock } from './../singleton';
import { XyzLayerModel } from './../src/api/crud/xyz-layer/xyz-layer.model';
test('Create new xyz-layer', async () => {
const model = new XyzLayerModel()
const newXyz = {
id: 1,
name: 'string',
description: 'string'
}
prismaMock.xyzLayer.create.mockResolvedValue(newXyz);
await expect(model.create(newXyz)).resolves.toEqual({
id: 1,
name: 'string',
description: 'string'
});
});
The following line is highlighted as an error by VSCode:
prismaMock.xyzLayer.create.mockResolvedValue(newXyz);
The error message says:
Type of property 'AND' circularly references itself in mapped type '{ [K in keyof { AND?: Enumerable<XyzLayerScalarWhereWithAggregatesInput>; OR?: Enumerable<XyzLayerScalarWhereWithAggregatesInput>; ... 11 more ...; updatedAt?: string | ... 1 more ... | DateTimeWithAggregatesFilter; }]: Or<...> extends 1 ? { ...; }[K] extends infer TK ? GetHavingFields<...> : never : {} extends Fiel...'.ts(2615)
The same applies to property 'NOT' and 'OR'.
Does someone know a solution for this problem?
Thank you in advance.