diff --git a/tests/embind/test_finalization.js b/tests/embind/test_finalization.js index 52b852ef12339..e2c0257e9cac6 100644 --- a/tests/embind/test_finalization.js +++ b/tests/embind/test_finalization.js @@ -2,6 +2,5 @@ Module.onRuntimeInitialized = () => { const foo1 = new Module.Foo("Constructed from JS"); const foo2 = Module.foo(); const foo3 = Module.pFoo(); + setTimeout(gc, 100); } - -setTimeout(gc, 100); diff --git a/tests/test_other.py b/tests/test_other.py index 506448a295bac..2c3bea444adbe 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2431,7 +2431,7 @@ def test_embind_finalization(self): self.run_process( [EMXX, test_file('embind/test_finalization.cpp'), - '--post-js', test_file('embind/test_finalization.js'), + '--pre-js', test_file('embind/test_finalization.js'), '--bind'] ) self.node_args += ['--expose-gc']