Skip to content

Conversation

DmitrySharabin
Copy link
Collaborator

Since we generate the tests on the fly, we need to make sure htest.js has something to work with (e.g., sections with tests). This lets us use the HTML-first mode of hTest to its full potential (tests navigation, isolation, etc). All those features will make debugging so much easier! However, we need this PR to be merged first.

Copy link

netlify bot commented Feb 2, 2025

Deploy Preview for style-observer ready!

Name Link
🔨 Latest commit 851aa88
🔍 Latest deploy log https://app.netlify.com/sites/style-observer/deploys/67a07a94d8174700089c0892
😎 Deploy Preview https://deploy-preview-34--style-observer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@DmitrySharabin DmitrySharabin changed the title [tests] Download htest.js after the test page is fully rendered [tests] Download htest.js after the page with tests is fully rendered Feb 2, 2025
@DmitrySharabin DmitrySharabin force-pushed the htest-full-potential branch 3 times, most recently from 375a1d1 to 851aa88 Compare February 3, 2025 08:13
@@ -48,6 +47,8 @@ <h1>Tests</h1>
`;
});
}

import("https://htest.dev/htest.js");
Copy link
Owner

Choose a reason for hiding this comment

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

I think reordering the scripts should work too (together with the TLA), since order is preserved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried it many times with different approaches (like with defer). But every time the isolation of test groups and individual tests remain broken, the code from htest.js is executed before the page with tests fully rendered. What am I doing wrong?

Copy link
Owner

Choose a reason for hiding this comment

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

You should never need defer when you’re using type=module. What did you try exactly?

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