octonom
Version:
Object Document Mapper for any database
8 lines (6 loc) • 353 B
text/typescript
import { ValidationError } from '../errors';
import { ISchemaParent } from './schema';
export function testValidation(validationPromise: Promise<any>, expectedMsg: string, expectedParent: ISchemaParent) {
return expect(validationPromise).to.be.rejectedWith(ValidationError, expectedMsg)
.and.eventually.have.property('parent', expectedParent);
}