Skip to content

Commit

Permalink
support options passed to Disposable, phetsims/axon#436
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 22, 2023
1 parent 036b406 commit 115f17b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/PhetioObjectTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ QUnit.test( 'PhetioObject is a Disposable', assert => {
object1.dispose();
assert.ok( object1.isDisposed, '1 is disposed' );
assert.ok( object2.isDisposed, '2 is disposed' );

const object3 = new PhetioObject( { isDisposable: false } );
const object4 = new PhetioObject();
object4[ 'initializePhetioObject' ]( {}, { isDisposable: false } );

if ( window.assert ) {
assert.throws( () => object3.dispose(), 'should throw if isDisposable is false1' );
assert.throws( () => object4.dispose(), 'should throw if isDisposable is false2' );
}
} );

Tandem.PHET_IO_ENABLED && QUnit.test( 'no calling addLinkedElement before instrumentation', assert => {
Expand Down

0 comments on commit 115f17b

Please sign in to comment.