First of all, thanks for this amazing and well thought out library.
From reading the jsdom docs, it appears that there was an api update that broke compatibility with pre api 10 versions of jsdom.
Using the latest jsdom (11.2.0), I wasn't able to get the code at https://mozilla.github.io/fathom/using.html#rules-sides-and-flows to work. Moreover, even after tweaking it for the new api, it breaks unexpectedly when querying facts against a boundedruleset.
I haven't investigated it in detail but it appears to be breaking at lhs.js
const matches = ruleset.doc.querySelectorAll(this.selector);
where jsdom used to expose querySelectorAll directly. For completeness, this is my stacktrace:
Uncaught TypeError: ruleset.doc.querySelectorAll is not a function
at DomLhs.fnodes (/Users/Ying/Code/sfpc/newspaper-headlines/node_modules/fathom-web/lhs.js:88:37)
at InwardRule.results (/Users/Ying/Code/sfpc/newspaper-headlines/node_modules/fathom-web/ruleset.js:315:37)
at BoundRuleset._execute (/Users/Ying/Code/sfpc/newspaper-headlines/node_modules/fathom-web/ruleset.js:215:31)
at BoundRuleset.get (/Users/Ying/Code/sfpc/newspaper-headlines/node_modules/fathom-web/ruleset.js:129:40)
at request (/Users/Ying/Code/sfpc/newspaper-headlines/index.js:30:21)
at ReadStream.<anonymous> (/Users/Ying/Code/sfpc/newspaper-headlines/node_modules/cached-request/lib/cached-request.js:249:15)
at emitNone (events.js:110:20)
at ReadStream.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1047:12)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
fnodes @ VM255 lhs.js:88
results @ VM249 ruleset.js:315
_execute @ VM249 ruleset.js:215
get @ VM249 ruleset.js:129
request @ VM60 index.js:30
(anonymous) @ VM63 cached-request.js:249
emitNone @ VM27 events.js:110
emit @ VM27 events.js:207
endReadableNT @ VM52 _stream_readable.js:1047
_combinedTickCallback @ VM39 next_tick.js:102
_tickCallback @ VM39 next_tick.js:161
I'm using node v8.1.3.
I tried to see what the query might look like on latest jsdom, but ran into some issues. I'd be happy to elaborate on it further.
For now, I downgraded jsdom to 8.5.0. If this is documented somewhere already, sorry for the repost. Otherwise, I can make a PR to the README to specify the dependency.