From 34aff27f9689e371e30962c973b2a337ec442e85 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Mon, 17 Aug 2020 15:06:24 -0700 Subject: [PATCH] Add missing workspace cleanup (#4167) --- tests/mocha/astnode_test.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index 6e12f74c0..e4302232e 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -88,7 +88,6 @@ suite('ASTNode', function() { fieldWithOutput: fieldWithOutput, valueInput: valueInput }; - sinon.stub(Blockly, "getMainWorkspace").returns(new Blockly.Workspace()); }); teardown(function() { sharedTestTeardown.call(this); @@ -308,19 +307,8 @@ suite('ASTNode', function() { var outputNextBlock = this.workspace.newBlock('output_next'); this.blocks.secondBlock = secondBlock; this.blocks.outputNextBlock = outputNextBlock; - - }); teardown(function() { - delete this.blocks.noNextConnection; - delete this.blocks.fieldAndInputs; - delete this.blocks.twoFields; - delete this.blocks.fieldAndInputs2; - delete this.blocks.noPrevConnection; - delete this.blocks.dummyInput; - delete this.blocks.dummyInputValue; - delete this.blocks.fieldWithOutput2; - delete Blockly.Blocks['output_next']; delete Blockly.Blocks['fields_and_input2']; delete Blockly.Blocks['two_fields']; @@ -337,7 +325,7 @@ suite('ASTNode', function() { this.blocks.singleBlock = singleBlock; }); teardown(function() { - delete this.blocks.singleBlock; + workspaceTeardown.call(this, this.singleBlockWorkspace); }); test('fromPreviousToBlock', function() { @@ -537,7 +525,7 @@ suite('ASTNode', function() { this.emptyWorkspace = new Blockly.Workspace(); }); teardown(function() { - delete this.emptyWorkspace; + workspaceTeardown.call(this, this.emptyWorkspace); }); test('fromInputToOutput', function() {