-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
I'd like to use eql to compare two objects:
expect(tokenizeTagText(text)).to.eql([new TextField('only text field')]);
But I get this using mocha:
RangeError: Maximum call stack size exceeded
However, if I change the test to use equal, they look the same:
Error: expected [ { name: 'only text field',
markup: { '0': <input value="only text field">, length: 1 } } ] to equal [ { name: 'only text field',
markup: { '0': <input value="only text field">, length: 1 } } ]
It seems the RangeError comes from expect.js.
It seems the issue is with comparing jQuery elements:
it('failing', function () {
expect([ { name: 'only text field',
markup: { '0': $('<input value="only text field">'), length: 1 } } ]).to.eql([ { name: 'only text field',
markup: { '0': $('<input value="only text field">'), length: 1 } } ]);
});
it('successful', function () {
expect([ { name: 'only text field',
markup: { '0': '<input value="only text field">', length: 1 } } ]).to.eql([ { name: 'only text field',
markup: { '0': '<input value="only text field">', length: 1 } } ]);
});
Metadata
Metadata
Assignees
Labels
No labels