INFRA-132 - Add .jshintrc. Cleanup tests/karama/unit.
authorTim Otten <totten@civicrm.org>
Tue, 27 Jan 2015 05:46:43 +0000 (21:46 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 27 Jan 2015 05:46:43 +0000 (21:46 -0800)
.jshintrc [new file with mode: 0644]
tests/karma/unit/crmAutosaveSpec.js
tests/karma/unit/crmCaseTypeSpec.js
tests/karma/unit/crmMailingSpec.js

diff --git a/.jshintrc b/.jshintrc
new file mode 100644 (file)
index 0000000..01ed920
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,12 @@
+{
+  "indent": 2,
+  "jasmine": true,
+  "predef": [
+    "angular",
+    "inject",
+    "module",
+
+    "CRM"
+  ],
+  "-W097": true
+}
\ No newline at end of file
index 7633e84ef74b0c761af27e2a1e02d6e68684872e..fc5926aefefd64925a089c433559eb71cac80200 100644 (file)
@@ -1,14 +1,6 @@
-describe('crmAutosave', function() {
+'use strict';
 
-  function using(name, values, func) {
-    for (var i = 0, count = values.length; i < count; i++) {
-      if (Object.prototype.toString.call(values[i]) !== '[object Array]') {
-        values[i] = [values[i]];
-      }
-      func.apply(this, values[i]);
-      jasmine.currentEnv_.currentSpec.description += ' (with "' + name + '" using ' + values[i].join(', ') + ')';
-    }
-  }
+describe('crmAutosave', function() {
 
   beforeEach(function() {
     module('crmUtil');
index c4917626abaae5d377a5a4c493c6c6b5462a5e1b..3b5d630723a276e04c9a7932f9edc9ca75ba2717 100644 (file)
@@ -167,11 +167,11 @@ describe('crmCaseType', function() {
     }));
 
     it('should load activity statuses', function() {
-      expect(scope.activityStatuses).toEqualData([apiCalls['actStatuses']['values']['272'], apiCalls['actStatuses']['values']['273']]);
+      expect(scope.activityStatuses).toEqualData([apiCalls.actStatuses.values['272'], apiCalls.actStatuses.values['273']]);
     });
 
     it('should load activity types', function() {
-      expect(scope.activityTypes).toEqualData(apiCalls['actTypes']['values']);
+      expect(scope.activityTypes).toEqualData(apiCalls.actTypes.values);
     });
 
     it('addActivitySet should add an activitySet to the case type', function() {
index db795bfaeb6122a915b0241d413b28f801fb53c8..89e966eee2de08b79114952c24ff8158d6971a1a 100644 (file)
@@ -14,7 +14,7 @@ describe('crmMailing', function() {
     beforeEach(function() {
       navigator = jasmine.createSpyObj('crmNavigator', ['redirect']);
       module(function ($provide) {
-        $provide.value('crmNavigator', navigator)
+        $provide.value('crmNavigator', navigator);
       });
       inject(['crmLegacy', function(crmLegacy) {
         crmLegacy.url({back: '/*path*?*query*', front: '/*path*?*query*'});