Estaba tratando de omitir las pruebas en función de la falla de la API para las pruebas de desintoxicación en las que estoy usando jest como corredor de prueba
const itif = (condition) => condition ? it : it.skip; const itif = (condition) => condition ? it : it.skip; describe('Example', () => { let condition1; let condition2; beforeEach(async () => { condition1 = await getResponseverifyArticles() ? true :false condition2 = await getNumberOfFollowers() ? true :false await device.launchApp(); }); console.log(condtion1) // --> giving undefined //so first test always skips itif(condition1)('should verify articles1' ,async() => { await expect(element(by.text('Articles:'))).toBeVisible() await getResponseverifyArticles() await expect(element(by.text('Articles:'))).toBeVisible() }); //same as aboue itif(condition2)('should see Articles screen2', async () => { await expect(element(by.text('Articles:'))).toBeVisible() await getNumberOfFollowers() }); }); async function getArticles() { let articles; await axios .get('https://raw.githubusercontent.com/adhithiravi/React-Hooks-Examples/master/testAPI.json') .then(response => { if (response.status === 200 || response.status === 201) { articles = response.data.articles } }) .catch(error => { console.error("error Message :",error.response.data) }); return articles } const getResponseverifyArticles = async()=>{ const res = await getArticles(); for (let item of res) { await expect(element(by.text(item.title))).toBeVisible() } } async function getNumberOfFollowers() { let nOfFollowers await axios .get('https://api.github.com/users/janbodnar') .then(response => { if (response.status === 200 || response.status === 201) { nOfFollowers = response.data.followers; } }) .catch(error => { console.warn("Requested URL :",error.response) }); return nOfFollowers } getNumberOfFollowers()De esta manera, estaba tratando de omitir las pruebas... pero no podía acceder a las condiciones del bloque beforeAll. ¿Hay alguna forma de acceder a esas condiciones de forma dinámica?