On the Jasmine website, I see that we can disable xdescribe or individual xit specifications. Is there a way to disable only waiting (e.g. xexpect )?
The reason I ask about this is because I am writing e2e tests using Protractor, and in our continuous integration we still (if ever) have access to the database, although we can run the real end locally tests with access to the database, for example.
I would like to mark individual expectations as optional, depending on configuration or environment variable. It would be nice to make the switch once, and then create a wrapper around to expect that this will happen only with local testing (with access to the database).
So, for example, I can create a new spec family:
if (process.env.DB_AVAILABLE) { dbit = it; } else { dbit = xit; }
and write specifications that depend on the database connection as follows:
dbit('creates new user', function () {});
Is there a way to do the same with expect (e.g. dbexpect )?
If there is anything fundamentally wrong with my approach, don’t hold it back and let me know.
source share