Skip to content

Make test teardown in __init.test.js synchronous#5477

Merged
dmarcos merged 1 commit intoaframevr:masterfrom
mrxz:test-teardown-speedup
Feb 27, 2024
Merged

Make test teardown in __init.test.js synchronous#5477
dmarcos merged 1 commit intoaframevr:masterfrom
mrxz:test-teardown-speedup

Conversation

@mrxz
Copy link
Contributor

@mrxz mrxz commented Feb 27, 2024

Description:
Removing the timeout from the teardown in __init.test.js speeds up test execution significantly on my machine. According to the accompanying comment this timeout is there to let detachCallbacks clean themselves up before considering the teardown complete. However, custom elements v1 uses disconnectedCallback which is (effectively) synchronous, and therefore the setTimeout should have no bearing on them.

Removing the timeout doesn't seem to have a negative impact. All tests are still green after making this change.

Changes proposed:

  • Make teardown synchronous in __init.test.js speeding up tests

@dmarcos
Copy link
Member

dmarcos commented Feb 27, 2024

Thanks

@dmarcos dmarcos merged commit 374ae6c into aframevr:master Feb 27, 2024
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