expect().to.be.ordered.members() throw an error "TypeError: Cannot read property 'members' of undefined"
See original GitHub issueCurrent behavior:
Whenever I try to compare array (order matters) with the command expect(...).to.be.ordered.members(...)
, Cypress always throw an error.
expect(...).ordered(...)
as shown here also failed.
https://docs.cypress.io/guides/references/assertions.html#BDD-Assertions
Desired behavior:
It should works.
Steps to reproduce: (app code and test code)
This code failed.
describe("First Test", () => {
it.only("This will failed", () => {
expect([0, 1]).to.be.ordered.members([0, 1]);
});
});
Versions
Cypress version: 3.2.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'members' of undefined
I was getting this error message when creating a new library. It turned out that in public_api.ts of that library, I was importing...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Expect / Should - Chai Assertion Library
expect (function () {}).to.not.throw(); expect({a: ... By default, strict ( === ) equality is used to compare array members and object properties.
Read more >Object.defineProperty() - JavaScript - MDN Web Docs
A TypeError is thrown when attempts are made to change non-configurable property attributes (except value and writable , if permitted), except ...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jennifer-shehane
ordered
is shown in the docs here: https://docs.cypress.io/guides/references/assertions.html#ChaiI’m guessing that’s automatic. But it’s also confusing 😦
The
ordered
flag was added inchai
version 4.x.x. Cypress is currently using chai version 3.5.0. Upgrading to 4.0 is part of our Cypress 4.0 release, so will be supported when that is released.Closing this issue as duplicate of https://github.com/cypress-io/cypress/issues/2529