Skip to content

Helper example won't run as is #193

Open
@jlaurens

Description

@jlaurens

The helpers page reads

Assertion.overwriteMethod('above', function (_super) {
  return function assertAge (n) {
    if (utils.flag(this, 'model.age')) {
       [...]

      // next, make sure we have an age
      new Assertion(obj).to.have.deep.property('_attrs.age').a('number'); //<<<< ERROR

      // now we compare
      [...]
  };
});

The assertion always fails because '_attrs.age' is not a valid property name.

If you do not want to remove it, simply replace it by

      new Assertion(obj._attrs).to.have.property('age').a('number');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions