Skip to content

pre and post conditions #2

Description

@matthewmueller

We need to let errors pass through on some of the relationships.

Right now the relationships get skipped when there's an error upstream, but the relationship may make the input still valid even if there's an error.

This illustrates it. Right now this doesn't throw, but it should because c is not present:

it('should throw because it\'s missing an attribute', function(done) {
  var schema = Rube({
    a: Rube(String),
    b: Rube(String),
    c: Rube(String)
  }).or('a', 'b');

  schema.only('c')({}, function(err, v) {
    assert(err);
    done();
  });
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions