You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// fastest-validator.ts file
import Validator from "fastest-validator";
const v = new Validator();
// usual usage follows
export const responseSchemaValidator = v.compile(responseSchema);
This file is imported in my main file as
import {
responseSchemaValidator
} from "../fastest-validator";
and it works without an issue.
Observed: when I create a Jest Typescript test file with the same import I get an error
● Test suite failed to run
TypeError: fastest_validator_1.default is not a constructor
4 | var fastest_validator_1 = require("fastest-validator");
> 5 | var v = new fastest_validator_1.default();
which makes it impossible for me to use the fastest_validator in the testing code.
I have a typescript file that starts like
This file is imported in my main file as
and it works without an issue.
Observed: when I create a Jest Typescript test file with the same import I get an error
which makes it impossible for me to use the fastest_validator in the testing code.
Expected:
fastest-validator
codeI use:
The text was updated successfully, but these errors were encountered: