Element.parentNode undefined?

307 views
Skip to first unread message

Tom Fennelly

unread,
Aug 2, 2015, 3:41:48 PM8/2/15
to js...@googlegroups.com
Hi guys.

I'm using jsdom version 5.6.1 (latest). The elements of the generated DOM don't seem to have a parentNode. Is this right, or is there some option I can turn on?

I saw PR #778 and got excited, but not sure it's what I need.

Thanks.

T.

Domenic Denicola

unread,
Aug 2, 2015, 4:07:28 PM8/2/15
to js...@googlegroups.com

Can you include a small (e.g. 10 line) test case showing the problem?

--
You received this message because you are subscribed to the Google Groups "jsdom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsdom+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Fennelly

unread,
Aug 4, 2015, 5:20:07 AM8/4/15
to jsdom
Ooops sorry for not replying ... I missed it.

A small bit of context ... I'm working on introducing better JavaScript modularization etc into the GUI parts of the open source Jenkins CI (you may or may not be familiar with it). To cut a long story short, we are looking at using jsdom to help write unit tests around the relevant parts of this code. At the moment, none of this code has any unit tests (there are functional tests alright). We want to change how some of this code works but, before doing that, we want to write tests to capture the current behaviour.

Lots of the current JS code in Jenkins is fairly old (pre jQuery etc). The first bit I tried to modularize and write tests around blew up because the code referenced the parentNode property and the DOM generated by jsdom doesn't seem to have that populated.
Regards,

T.

Tom Fennelly

unread,
Aug 4, 2015, 5:40:47 AM8/4/15
to jsdom
Ignore me ... I'm an idiot. Driver error. I was not properly getting the underlying DOM element from jQuery. jsdom does indeed populate the parentNode.

Sorry guys.
Reply all
Reply to author
Forward
0 new messages