gost-dom / gost-dom/browser

Customize time travelling on implicit event loop progression

Open
#44 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
300
Forks
15
PR merge metrics
No merged PRs in 30d

Description

When client script is executed, either because of a `` tag, or executing an event handler/timeout handler, all immediately enqueued items are implicitly executed. I.e., all timeouts registered for the current simulated point in time.

For an application might have animations, the events may be registered in the future, and will require tests to explicitly advance time, either by a specific amount, calling `Clock.Advance`, or just run all scheduled handlers calling `Clock.RunAll`.

To keep test code focused on behaviour, such calls become noise, and a way to handle it would be to allow the test code to specify an amount of time to implicitly increment, or implicitly run all enqueued tasks.

It is more likely that test code doesn't care about the amount of time that passes, and only in the rarer cases when you want to explicitly verify debounce/throttle behaviour, that the test need 100% control over simulated time.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how script execution, event handlers, and timeout handlers implicitly run enqueued items, then compare that flow with Clock.Advance and Clock.RunAll. Done means tests can configure implicit time advancement or run-all behavior while retaining explicit control for debounce and throttle tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.