I am encountering an issue while trying to run a testcase with multiple data fixtures constructed using an object array in Cypress. The error message states: TS2345: Argument of type '(fixture: { name: string; sValue: string; eValue: string}) => void' is not assignable to parameter of type '(value: { name: string; sValue: string; eValue: string}, index: number, array: { name: string; sValue: string; eValue: string; }[]) => void'. Can anyone explain why this error occurs and what mistake I might have made?
const Fixtures = [
{
name: 'name1',
sValue: 'a',
eValue: '1',
},
{
name: 'name2',
sValue: 'b',
eValue: '2',
},
];
Fixtures.forEach(
(fixture: {
name: string;
sValue: string;
eValue: string;
}) => {
describe(`${fixture.name} test`, () => {
it(`set value ${fixture.sValue}`, () => {
...
});
it(`check ${fixture.name} on ${fixture.sValue}`, () => {
...
});
it('check test4', () => {
...
});
it('check testcase 5', () => {
...
});
});
}
);