Fix workspace cleanup in tests. (#4169)

This commit is contained in:
Monica Kozbial
2020-08-19 15:40:12 -07:00
committed by GitHub
parent 2e2a5c230e
commit afd10cb3a2
4 changed files with 4 additions and 3 deletions

View File

@@ -1234,6 +1234,7 @@ suite('Blocks', function() {
});
teardown(function() {
Blockly.Events.enable();
workspaceTeardown.call(this, this.workspace);
delete Blockly.Blocks['variable_block'];
});
suite('Connecting and Disconnecting', function() {

View File

@@ -660,7 +660,7 @@ suite('Events', function() {
// Expect the workspace to not have a variable with ID 'test_block_id'.
chai.assert.isNull(this.workspace.getVariableById(TEST_BLOCK_ID));
} finally {
workspaceSvg.dispose();
workspaceTeardown.call(this, workspaceSvg);
}
});

View File

@@ -392,7 +392,7 @@ suite('Abstract Fields', function() {
this.workspace.createDom();
});
teardown(function() {
this.workspace = null;
workspaceTeardown.call(this, this.workspace);
});
test('Before Append', function() {
Blockly.Blocks['tooltip'] = {

View File

@@ -38,7 +38,7 @@ suite('Procedures XML', function() {
};
});
teardown(function() {
this.workspace.dispose();
workspaceTeardown.call(this, this.workspace);
});
suite('Definition Blocks', function() {