Open cableray opened 7 years ago
[1]
doesn't give you a wrapped element. I think you want .at(1)
.
Strangely, .at
is undefined on wrapper
and the result of find('a')
🤔. Is that normal?
Versions:
cheerio@0.22.0
chai-enzyme@0.7.1
ah, sorry, you're using render
. You want .eq(1)
then, just like in jquery. Array bracket syntax gets you a raw, unwrapped thing.
Ok, thanks @ljharb! It is a bummer that this doesn't work with other chai tools like chai-things
because of not being a real array, but I'm not sure that would be an easy thing to do.
cheerio@v1.0.0-rc.2
is published. Could we have that as an acceptable peer?
For example:
fails (because it expects
secondLink
to respond tofirst()
, but it isn't an array of results)This makes it impossible to assert on specific items in an array of results.