How can a data value be updated after the new value is fetched using cy.intercept()?
let data = [
{
track: 'Track 1',
case: [{name: 'case 1.1'}, {name: 'case 1.2'}],
},
];
describe(`All test`, {tags: '@testConcept'}, () => {
beforeEach(() => {
// LOGIN and fetching new data and updating
data = [
{
track: 'Track 3',
case: [{name: 'case 3.1'}, {name: 'case 3.2'}],
},
];
});
data.forEach((el) => {
describe(`Test :`, () => {
it(`Test Track : ${JSON.stringify(el.track)}`, () => {
cy.log(el.track); // expected Track 3
});
el.case.forEach((el2) => {
it(`Test case : ${JSON.stringify(el2.name)}`, () => {
cy.log(el2.name); // expected Track 3.1
});
});
});
});
});
The data variable is getting hosted and the value is not getting changed
