You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing integrations tests, it is common that a subset of tests require some configuration to be present, e.g. database connection URI. It is desirable not to run tests when that configuration is not present.
Proposed implementation
I would like to be able to skip a test from a within the test itself, e.g.
test('authenticates using captcha',async(t)=>{if(!process.env.CAPTCHA_SOLVE_ID){returnt.skip('CAPTCHA_SOLVE_ID is not configured');}constcaptchaSolver=createCaptchaSolver(process.env.CAPTCHA_SOLVE_ID);consterror=awaitt.throwsAsync(createAuthenticationCookieJar(captchaSolver,'[email protected]','bar'));t.true(errorinstanceofAuthenticationError);t.is(error.message,'Invalid email or password.');});
The text was updated successfully, but these errors were encountered:
constmain=()=>{if(!process.env.CAPTCHA_SOLVE_ID){test.todo('integration tests cannot run because process.env.CAPTCHA_SOLVE_ID is not configured');return;}test('authenticates using captcha',async(t)=>{constcaptchaSolver=createCaptchaSolver(process.env.CAPTCHA_SOLVE_ID);consterror=awaitt.throwsAsync(createAuthenticationCookieJar(captchaSolver,'[email protected]','bar'));t.true(errorinstanceofAuthenticationError);t.is(error.message,'Invalid email or password.');});};main();
Uh oh!
There was an error while loading. Please reload this page.
Use case
When writing integrations tests, it is common that a subset of tests require some configuration to be present, e.g. database connection URI. It is desirable not to run tests when that configuration is not present.
Proposed implementation
I would like to be able to skip a test from a within the test itself, e.g.
The text was updated successfully, but these errors were encountered: