Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we JSON stringify instead of printing [object Object] on failing tests? #43

Open
Wizek opened this issue Oct 15, 2014 · 1 comment

Comments

@Wizek
Copy link

Wizek commented Oct 15, 2014

Current behaviour:

Then clause `this.ko.contextFor(this.el.find('div')[0]).$data === this.koRootContext.$data` failed by returning false

    This comparison was detected:
      this.ko.contextFor(this.el.find('div')[0]).$data === this.koRootContext.$data
      [object Object] === [object Object]

Desired behaviour:

Then clause `this.ko.contextFor(this.el.find('div')[0]).$data === this.koRootContext.$data` failed by returning false

    This comparison was detected:
      this.ko.contextFor(this.el.find('div')[0]).$data === this.koRootContext.$data
      {a: 1} === {a: 2}
@searls
Copy link
Owner

searls commented Oct 16, 2014

Sounds good to me. It would need try/catch for cyclic failures and fall back on current behavior. Also, since === is an identity comparator, I'm not really sure what good it would do if two things looked identical but had different identities.

Currently the lib will warn you when two objects fail === but would pass the toEqual matcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants