Skip to content

chore: speed up layout tests#1565

Merged
marvinhagemeister merged 1 commit into
mainfrom
test-speed
Aug 1, 2023
Merged

chore: speed up layout tests#1565
marvinhagemeister merged 1 commit into
mainfrom
test-speed

Conversation

@marvinhagemeister

@marvinhagemeister marvinhagemeister commented Aug 1, 2023

Copy link
Copy Markdown
Contributor

The layout tests were a bit slow. Noticed that they only check if the server sent HTML is correct and don't need any JS to be executed client side. This means we can skip launching a full puppeteer process and simply assert against the fetched HTML. This brings down the layout test time from a couple of seconds down to <100ms.

Wrote a tiny pretty printer that parsers the linkedom document into something for humans to debug when for example a selector isn't found:

Screenshot 2023-08-01 at 15 33 18

Note the charset casing issue is resolved in preact-render-to-string, just need to cut a new version

@bartlomieju bartlomieju left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice!

@marvinhagemeister marvinhagemeister merged commit 813ee22 into main Aug 1, 2023
@marvinhagemeister marvinhagemeister deleted the test-speed branch August 1, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants