Commit Graph

6652 Commits (14db2e52c2014c821532bb87e27dc356c80039b8)

Author SHA1 Message Date
John McLear 4c825d3060 longer timeouts 2021-01-27 05:48:09 +00:00
John McLear 55ac85473c more realistic timeouts for slower devices 2021-01-27 05:43:48 +00:00
John McLear 5d276944a8 more realistic timeouts for slower devices 2021-01-27 05:38:29 +00:00
John McLear 21736122a0 more realistic timeouts for slower devices 2021-01-27 05:37:54 +00:00
John McLear 2816820785 more realistic timeouts for slower devices 2021-01-27 05:24:33 +00:00
John McLear 928f1ef8ce more realistic timeouts for slower devices 2021-01-27 05:23:33 +00:00
John McLear 53708e69eb more realistic timeouts for slower devices 2021-01-27 05:23:05 +00:00
John McLear a6406663f4 more realistic timeouts for slower devices 2021-01-27 05:22:24 +00:00
John McLear 929859042c more realistic timeouts for slower devices 2021-01-27 05:19:04 +00:00
John McLear 01ac40dc56 more realistic timeouts for slower devices 2021-01-27 05:15:44 +00:00
John McLear 88d99c0d60 more realistic timeouts for slower devices 2021-01-27 05:15:17 +00:00
Richard Hansen e5b45cc984 contentcollector: Delete unnecessary `dom` functions
And move the remaining functions out of the `makeContentCollector()`
function.
2021-01-27 04:59:36 +00:00
Richard Hansen 275f041fbb contentcollector: Simplify child node access 2021-01-27 04:59:36 +00:00
Richard Hansen 1cb5453aeb contentcollector: Skip over non-Text, non-Element Nodes 2021-01-27 04:59:36 +00:00
Richard Hansen 075969aea0 contentcollector: Fix Element tag name fetch
The `name` property is only available on cheerio's Element-like
objects; DOM Element objects do not have a `name` property. Switch to
`dom.tagName()` to fix the logic for browsers.
2021-01-27 04:59:36 +00:00
Richard Hansen e3ec9d9a4c contentcollector: Fix parent node access
The `parent` property is only available on cheerio's Node-like
objects; DOM Node objects do not have a `parent` property. Switch to
the `parentNode` property so that the code works in browsers as well
as cheerio.
2021-01-27 04:59:36 +00:00
Richard Hansen 1d36549152 contentcollector: Delete unnecessary parentheses 2021-01-27 04:59:36 +00:00
Richard Hansen e3a47e48f9 contentcollector: Fix collectContentLineText hook
Before, the hook always ignored the return values provided by the hook
functions. Now the hook functions can change the text by either
returning a string or setting `context.text` to the desired value.

Also drop the `styl` and `cls` context properties. They were never
documented and they were always null.
2021-01-27 04:59:36 +00:00
Richard Hansen 4e220538a1 contentcollector: Use destructuring to improve readability 2021-01-27 04:59:36 +00:00
Richard Hansen b547ce9a47 contentcollector: Invert logic to improve readability 2021-01-27 04:59:36 +00:00
Richard Hansen b811030846 contentcollector: Delete unnecessary truthiness check 2021-01-27 04:59:36 +00:00
Richard Hansen fc2420c244 contentcollector: Fix iteration over child Nodes
In the DOM, `.children` only includes children that are Element
objects. In cheerio 0.22.0, `.children` includes all child Nodes, not
just Elements. Use `dom.numChildNodes()` and `dom.childNode()` so that
browsers behave the same as cheerio.
2021-01-27 04:59:36 +00:00
Richard Hansen d0bfb54c0a contentcollector: Avoid `for..in` iteration of object properties
`for..in` iterates over inherited properties, which is almost never
desired. In most cases there aren't any inherited enumerable
properties so it's not that big of a deal, but in the case of
HTMLCollection it's very bad because it iterates over every entry
twice (once by numerical index and once by name) plus it includes the
`length` property in the iteration.
2021-01-27 04:59:36 +00:00
Richard Hansen 3cfec58948 contentcollector: Rename `dom` functions for consistency with DOM spec 2021-01-27 04:59:36 +00:00
Richard Hansen 8763c3bb29 contentcollector: Fix Element attribute accesses
The `attribs` property is only available on cheerio's Element-like
objects; DOM Element objects do not have an `attribs` property. Switch
to `dom.nodeAttr()` to fix the logic for browsers.
2021-01-27 04:59:36 +00:00
Richard Hansen 99625950c8 contentcollector: Factor out call to `.toLowerCase()` 2021-01-27 04:59:36 +00:00
Richard Hansen dd7fb1babe contentcollector: Document the `dom` object 2021-01-27 04:59:36 +00:00
Richard Hansen 74bb2f76cc contentcollector: Delete unused `domInterface` parameter 2021-01-27 04:59:36 +00:00
Richard Hansen 42c25b2536 openapi: Fix error logging 2021-01-27 04:59:36 +00:00
Richard Hansen 56f617060a tests: Fix missing call to `done` callback 2021-01-27 04:59:36 +00:00
Richard Hansen b164f9b431 tests: Replace "expected" with "want", "received" with "got"
"Got" and "want" are common terms for testing, plus this fixes a
spelling mistake ("received" was misspelled as "recieved").
2021-01-27 04:59:36 +00:00
Richard Hansen fc69ae78aa tests: Use `assert.deepEqual()` to simplify equality checks 2021-01-27 04:59:36 +00:00
Richard Hansen dd815892f2 tests: Delete erroneous `describe()` calls
`describe()` is meant to be used by independent tests, but the tests
in this file are not independent. Add a higher-level `describe()` call
and delete all of the `describe()` calls that wrap a single test.
2021-01-27 04:59:36 +00:00
Richard Hansen 32a0df4883 tests: Fix invalid HTML in contentcollector tests
The HTML spec does not permit `<pre>` as a child of `<p>`.
2021-01-27 04:59:36 +00:00
Richard Hansen 53160f4a21 tests: Delete invalid contentcollector test
The HTML spec doesn't allow `<ul>` to be a child of `<ol>` (it must be
a child of `<li>` instead).
2021-01-27 04:59:36 +00:00
Richard Hansen 906b2624ed tests: Re-enable import/export test that is now working 2021-01-27 04:59:36 +00:00
Richard Hansen 54a3dbb9a0 lint: Fix some straightforward ESLint errors 2021-01-27 04:59:36 +00:00
John McLear edf1dabe65 low hanging lint and some hard coded timeouts 2021-01-27 04:53:28 +00:00
John McLear 809670dbea derp 2021-01-26 21:42:52 +00:00
John McLear 986894f776 derp 2021-01-26 21:28:19 +00:00
John McLear ff708c7160 derp 2021-01-26 20:00:14 +00:00
John McLear d8ec9309d5 derp 2021-01-26 19:57:01 +00:00
John McLear f6285e10e0 derp 2021-01-26 19:53:19 +00:00
John McLear d74782c7e6 make mocha show duration and include the first timeout value in a test 2021-01-26 19:42:23 +00:00
John McLear f2b54af6a4 testing 4 runners, will it be too much 2021-01-26 19:19:15 +00:00
John McLear b12becb6fb testing 4 runners, will it be too much 2021-01-26 19:18:27 +00:00
John McLear f3677feba1 testing 4 runners, will it be too much 2021-01-26 18:55:16 +00:00
John McLear 1b74f29f7b PL 2021-01-26 17:46:04 +00:00
John McLear 45d54ca874 perf test 2021-01-26 16:50:04 +00:00
John McLear 48ebc3af5a perf test 2021-01-26 16:48:08 +00:00