Skip to content

Improve metadata checks #847

Closed
Closed
@jamestalmage

Description

@jamestalmage

We currently validate the test metadata property in two different places:

  • todo is checked here
  • always and only 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions