Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite improvements #74

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Conversation

botandrose
Copy link
Collaborator

Some test suite improvements. Three commits:

  1. Code coverage was covering things we didn't care about, like the morphdom source in test/lib. Set it to only cover files in src/.
  2. Extract the duplicated: beforeEach(function() { clearWorkArea(); }); in each test file to just a single setup() call. This also comes in handy for...
  3. Add npm test-move-before for running the tests in a browser with Element#moveBefore enabled. This was a bit tricky to do! Details below:

Ideally it'd just be a separate browser run in the main CI job, but it was surprisingly difficult to get a browser with the chrome://flags/#atomic-move experiment enabled. You can't enable it at runtime, the browser needs to boot up with that flag already enabled for it work. But there's no command-line flag to do so! The only way I could figure out how to do this was to dig into the on-disk Chrome profile and manually munge in the setting. So its currently a separate npm script: npm run test-move-before, and this is run as a separate job in the GitHub Actions CI.

In addition I've added a line to setup() that fails the test if the browser is expected to respond to moveBefore but doesn't, just to make sure we're testing what we think we're testing in that run.

@1cg 1cg merged commit 65f32e5 into bigskysoftware:main Dec 17, 2024
2 checks passed
@botandrose botandrose deleted the test-suite-improvements branch December 18, 2024 19:14
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.

3 participants