From fa97e8ca899fb7c665c0fbc795bcf3510c585708 Mon Sep 17 00:00:00 2001 From: samreid Date: Mon, 12 Oct 2020 09:33:31 -0600 Subject: [PATCH] Launch Tandem if it has not been launched already, so that phetioAPIValidation can run, see https://github.com/phetsims/scenery/issues/1046 --- js/nodes/NodeTests.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/nodes/NodeTests.js b/js/nodes/NodeTests.js index 8e176b26e..0e6ef1200 100644 --- a/js/nodes/NodeTests.js +++ b/js/nodes/NodeTests.js @@ -161,6 +161,11 @@ if ( Tandem.PHET_IO_ENABLED ) { QUnit.test( 'Node instrumented visible Property', assert => { + const wasLaunched = Tandem.launched; + if ( !Tandem.launched ) { + Tandem.launch(); + } + const apiValidation = phet.tandem.phetioAPIValidation; const previousEnabled = apiValidation.enabled; const previousSimStarted = apiValidation.simHasStarted; @@ -377,5 +382,9 @@ if ( Tandem.PHET_IO_ENABLED ) { otherInstrumentedVisibleProperty.dispose(); apiValidation.simHasStarted = previousSimStarted; apiValidation.enabled = previousEnabled; + + if ( !wasLaunched ) { + Tandem.unlaunch(); + } } ); }