I've been attempting to utilize the describe.eachtable
feature with TypeScript, but I keep running into an error message stating: "error TS2349: This expression is not callable. Type 'String' has no call signatures."
Below is my code snippet:
it.each(
`field | expectedMessage
${"username"} | ${"Username cannot be null"}
`(
"returns $expectedMessage when $field is null",
async ({ field, expectedMessage }) => {
...
)
);
In Visual Studio Code (VSCode), the error appears like this:
https://i.stack.imgur.com/3egy3.png I'm unsure how to resolve this typing issue because the syntax seems a bit unfamiliar to me.
I attempted to type it based on the guidance from the documentation as follows:
it.each(<{field: string; expectedMessage: string}>
`field | expectedMessage
${"username"} | ${"Username cannot be null"}
`(
However, the situation only deteriorated: