Skip to content

Commit

Permalink
Make test teardown in __init.test.js synchronous (#5477)
Browse files Browse the repository at this point in the history
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
  • Loading branch information
mrxz and mrxz committed Feb 27, 2024
1 parent c16cd8f commit 374ae6c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/__init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ window.addEventListener('unhandledrejection', event => {
pendingErrorNotice = 'An uncaught promise rejection occurred between tests';
});

teardown(function (done) {
teardown(function () {
// Clean up any attached elements.
var attachedEls = ['canvas', 'a-assets', 'a-scene'];
var els = document.querySelectorAll(attachedEls.join(','));
Expand All @@ -93,11 +93,6 @@ teardown(function (done) {
delete AFRAME.components.test;
delete AFRAME.systems.test;

// Allow detachedCallbacks to clean themselves up.
setTimeout(function () {
done();
});

if (pendingError) {
console.error(pendingErrorNotice);
throw pendingError;
Expand Down

0 comments on commit 374ae6c

Please sign in to comment.