While this SO article covers how to skip tests in javascript. The discussion doesn't cover how to do the same thing in TypeScript.
Example of not working code:
describe('Example test suite',() => {
before(async () => {
if(true) {
console.log('Unexpected condition. Test results may be invalid. Skipping tests.');
this.skip();
}
});
it('it will do something',async () => {
console.log('This should not run.');
});
});
Results:
error TS2532: Object is possibly 'undefined'.