Files
twenty/packages/twenty-server/test/integration/metadata/utils/warn-if-no-error-but-expected-to-fail.util.ts
T
Félix Malfait 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

18 lines
451 B
TypeScript

import { isDefined } from 'class-validator';
import { type Response } from 'supertest';
type WarnIfNoErrorButExpectedToFailInput = {
response: Response;
errorMessage: string;
};
export const warnIfNoErrorButExpectedToFail = ({
response,
errorMessage,
}: WarnIfNoErrorButExpectedToFailInput) => {
if (isDefined(response.body.data)) {
expect(false).toEqual(errorMessage);
}
expect(response.body.errors.length).toBeGreaterThan(0);
};