you could do that you could also return some resul...
# help
m
you could do that you could also return some result out of the function, destructure it like a react hook , assign to a local var and use that local var through the it blocks
Copy code
js
let ninjaVar, ninjaVar2, ninjavar3

before(() => cy.doStuff().then(({so, many, vars}) => {
ninjaVar = so
ninjaVar2 = many
ninjaVar3 = vars
})

it('...', () => {
  cy.log(ninjaVar)
  ...
})
check out these https://dev.to/muratkeremozcan/crud-api-testing-a-deployed-service-with-cypress-using-cy-api-spok-cypress-data-session-cypress-each-4mlg https://dev.to/muratkeremozcan/api-testing-event-driven-systems-7fe