Skip to content

Commit

Permalink
refactor(tests): Use generator dictionary in insertion marker test
Browse files Browse the repository at this point in the history
The use of generators in insertion_marker_test.js was overlooked
in the earlier commit making such updates, and some test here
were failing due to lack of cleanup in
cleanup in the generator_test.js.
  • Loading branch information
cpcallen committed Jun 13, 2023
1 parent 862df95 commit c3668d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/mocha/insertion_marker_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ suite('InsertionMarkers', function () {
});
suite('Code Generation', function () {
setup(function () {
javascriptGenerator['stack_block'] = function (block) {
javascriptGenerator.forBlock['stack_block'] = function (block) {
return 'stack[' + block.id + '];\n';
};
javascriptGenerator['row_block'] = function (block) {
javascriptGenerator.forBlock['row_block'] = function (block) {
const value = javascriptGenerator.valueToCode(
block,
'INPUT',
Expand All @@ -64,7 +64,7 @@ suite('InsertionMarkers', function () {
const code = 'row[' + block.id + '](' + value + ')';
return [code, javascriptGenerator.ORDER_NONE];
};
javascriptGenerator['statement_block'] = function (block) {
javascriptGenerator.forBlock['statement_block'] = function (block) {
return (
'statement[' +
block.id +
Expand All @@ -83,9 +83,9 @@ suite('InsertionMarkers', function () {
};
});
teardown(function () {
delete javascriptGenerator['stack_block'];
delete javascriptGenerator['row_block'];
delete javascriptGenerator['statement_block'];
delete javascriptGenerator.forBlock['stack_block'];
delete javascriptGenerator.forBlock['row_block'];
delete javascriptGenerator.forBlock['statement_block'];
});
test('Marker Surrounds', function () {
const xml = Blockly.utils.xml.textToDom(
Expand Down

0 comments on commit c3668d4

Please sign in to comment.