diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 091503721..d05c7ba98 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -199,14 +199,10 @@ suite('Connection Database', function() { setup(function() { // Ignore type checks. sinon.stub(this.database.connectionChecker_, 'doTypeChecks') - .callsFake(function(_a, _b) { - return true; - }); + .returns(true); // Ignore safety checks. sinon.stub(this.database.connectionChecker_, 'doSafetyChecks') - .callsFake(function(_a, _b) { - return Blockly.Connection.CAN_CONNECT; - }); + .returns(Blockly.Connection.CAN_CONNECT); // Skip everything but the distance checks. sinon.stub(this.database.connectionChecker_, 'doDragChecks') .callsFake(function(a, b, distance) { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index b1be8f7d0..5b3dc34b0 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -730,7 +730,7 @@ suite('Events', function() { // The first varCreate and move event should have been ignored. sinon.assert.callCount(this.changeListenerSpy, 3); // Expect two events on undo stack: varCreate and block create. - chai.assert.equal(2, this.workspace.undoStack_.length, + chai.assert.equal(this.workspace.undoStack_.length, 2, 'Undo stack length'); assertNthCallEventArgEquals( diff --git a/tests/mocha/navigation_test.js b/tests/mocha/navigation_test.js index ba2b5a9c7..555520340 100644 --- a/tests/mocha/navigation_test.js +++ b/tests/mocha/navigation_test.js @@ -395,9 +395,7 @@ suite('Navigation', function() { var block = this.workspace.getTopBlocks()[0]; var field = block.inputList[0].fieldRow[0]; - sinon.stub(field, 'onBlocklyAction').callsFake(function(){ - return true; - }); + sinon.stub(field, 'onBlocklyAction').returns(true); this.workspace.getCursor().setCurNode(Blockly.ASTNode.createFieldNode(field)); var isHandled = Blockly.navigation.onBlocklyAction(Blockly.navigation.ACTION_OUT);