Skip to content

Instantly share code, notes, and snippets.

@jaredlockhart
Created September 14, 2016 15:06
Show Gist options
  • Select an option

  • Save jaredlockhart/7abf6249c2a27cd0e84c31e94977a836 to your computer and use it in GitHub Desktop.

Select an option

Save jaredlockhart/7abf6249c2a27cd0e84c31e94977a836 to your computer and use it in GitHub Desktop.
Design-driving demos
✓ handles a simple series of short-circuiting rules (55ms)
{ element: HTMLParagraphElement {},
score: 5,
flavors: Map { 'paragraphish' => { inlineLength: 16 } } }
[ HTMLParagraphElement {},
HTMLParagraphElement {},
HTMLDivElement {},
HTMLParagraphElement {} ]
1) takes a decent shot at doing Readability's job
Ranker tests
✓ scores a node with a simple DOM rule and inserts an empty scribble
✓ applies flavored rules when there is input for them
Utils tests
distance()
✓ considers a node 0 distance from itself
✓ considers deeper nodes farther than shallower
✓ doesn't crash over different-lengthed subtrees
✓ rates descents through similar tags as shorter
✓ punishes the existence of stride nodes
clusters()
✓ groups nearby similar nodes together
9 passing (233ms)
1 failing
1) Design-driving demos takes a decent shot at doing Readability's job:
TypeError: Cannot read property 'parentNode' of null
at distance (utils.js:9:8176)
at new DistanceMatrix (utils.js:9:11032)
at clusters (utils.js:9:14144)
at Context.<anonymous> (test/demos.js:97:33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment