My test suite is failing to run because the "File" input type is undefined. This only happens when trying to run tests. The app works perfectly in development. Below is my console output.
$ nx run build-support-cases-api-core:test
> nx run build-support-cases-api-core:test
FAIL build-support-cases-api-core libs/build-support-cases/api/core/src/lib/__test__/buildSupportCase.service.spec.ts
● Test suite failed to run
ReferenceError: File is not defined
4 | export class CreateReceiptInput {
5 | @Field(() => String)
> 6 | public receipt: File;
| ^
7 |
8 | @Field(() => String)
9 | public vendorName: string;
at Object.<anonymous> (../../../core/database/receipt/src/lib/dto/createReceipt.input.ts:6:19)
at Object.<anonymous> (../../../core/database/receipt/src/lib/dto/createReceipt.dto.ts:1:1)
Here is the full source file for completeness
import { Field, ID, InputType } from "@nestjs/graphql";
@InputType()
export class CreateReceiptInput {
@Field(() => String)
public receipt: File;
@Field(() => String)
public vendorName: string;
@Field(() => Date)
public purchaseDate: Date;
@Field(() => Number)
public totalDollarAmount: number;
@Field(() => String)
public purchasedBy: string;
@Field(() => String)
public note: string;
@Field(() => ID)
public updateId?: number;
}
Is there something in a config file somewhere that I am missing? How do I get past this issue so that my tests will run?