From 089c30baa11c7e27f67c8d406932c8649203180a Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 9 Jan 2019 13:31:07 -0800 Subject: [PATCH] Add eslintrc to mocha directory --- tests/mocha/.eslintrc | 20 ++++++++++++++++++++ tests/mocha/block_test.js | 6 ------ tests/mocha/event_test.js | 11 ++--------- tests/mocha/field_variable_test.js | 7 ------- tests/mocha/test_helpers.js | 1 - tests/mocha/utils_test.js | 5 ----- 6 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 tests/mocha/.eslintrc diff --git a/tests/mocha/.eslintrc b/tests/mocha/.eslintrc new file mode 100644 index 000000000..c887877f6 --- /dev/null +++ b/tests/mocha/.eslintrc @@ -0,0 +1,20 @@ +{ + "env": { + "browser": true, + "mocha": true + }, + "globals": { + "chai": false, + "sinon": false, + "assertNull": true, + "assertNotNull": true, + "assertEquals": true, + "assertTrue": true, + "assertFalse": true, + "isEqualArrays": true, + "assertUndefined": true, + "assertNotUndefined": true + + }, + "extends": "eslint:recommended" +} diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 12c7871ef..5613d40ec 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -1,10 +1,4 @@ -// Declare some globals to make eslint happier. -// TODO: make an eslint config that applies to this directory and put this -// configuration in that file, instead of inline. -/* global suite, test, setup, teardown */ - -/* global assertNull, assertEquals */ suite('Blocks', function() { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index fc836774f..e88d379a8 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -1,12 +1,4 @@ -// Declare some globals to make eslint happier. -// TODO: make an eslint config that applies to this directory and put this -// configuration in that file, instead of inline. -/* global suite, test, setup, teardown */ -/* global sinon */ - -/* global assertNotNull, assertNotUndefined, assertNull, assertEquals, - isEqualArrays, assertUndefined */ suite('Events', function() { setup(function() { this.workspace = new Blockly.Workspace(); @@ -39,7 +31,8 @@ suite('Events', function() { function checkExactEventValues(event, values) { var keys = Object.keys(values); - for (var i = 0, field; field = keys[i]; i++) { + for (var i = 0; i < keys.length; i++) { + var field = keys[i] assertEquals(values[field], event[field]); } } diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 622c5c1eb..da8338c38 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -1,11 +1,4 @@ -// Declare some globals to make eslint happier. -// TODO: make an eslint config that applies to this directory and put this -// configuration in that file, instead of inline. -/* global suite, test, chai, setup, teardown */ - -/* global assertNull, assertEquals, isEqualArrays */ - suite('Variable Fields', function() { function getMockBlock(workspace) { return { diff --git a/tests/mocha/test_helpers.js b/tests/mocha/test_helpers.js index 0f0899231..deea338e8 100644 --- a/tests/mocha/test_helpers.js +++ b/tests/mocha/test_helpers.js @@ -1,4 +1,3 @@ -/* global chai */ /* exported assertEquals, assertTrue, assertFalse, assertNull, assertNotNull, isEqualArrays, assertUndefined, assertNotUndefined */ function _argumentsIncludeComments(expectedNumberOfNonCommentArgs, args) { diff --git a/tests/mocha/utils_test.js b/tests/mocha/utils_test.js index fb651ae3f..05fce6f3a 100644 --- a/tests/mocha/utils_test.js +++ b/tests/mocha/utils_test.js @@ -1,9 +1,4 @@ -// Declare some globals to make eslint happier. -// TODO: make an eslint config that applies to this directory and put this -// configuration in that file, instead of inline. -/* global suite, test, chai, assertFalse, assertTrue, assertEquals */ - suite('Utils', function() { test('genUid', function() { var uuids = {};