Closed
Description
We currently validate the test metadata
property in two different places:
todo
is checked herealways
andonly
are checked here- We currently allow
failing
on any test or hook, but as discussed here, we probably only want to allow that on tests, not hooks. - I'm not sure we prevent
skip.only
anywhere, but we probably should.
This should probably all be extracted into lib/validate-test.js
, with something like this:
// validate-test.js
module.exports = function(title, fn, metadata) {
// throws? Then we need to wrap with a try/catch (which is slow).
// returns a String with the rejection reason, returning null means it's good?
};
This would simplify our tests for these validations as well (they could be unit tests for this validation module, instead of integration tests that require spinning up forks).