Просмотр исходного кода

Merge branch 'master' of https://github.com/avindra/fullcalendar into dynamic-options

Adam Shaw 9 лет назад
Родитель
Сommit
c647773a8e

+ 11 - 0
.travis.yml

@@ -2,5 +2,16 @@ language: node_js
 node_js:
   - 'node' # implies latest version
 
+cache:
+  directories:
+  - node_modules
+  - lib
+
+env:
+  - CMD=test
+  - CMD=lint
+
 before_script:
   - bower install
+
+script: npm run $CMD

+ 2 - 1
package.json

@@ -57,6 +57,7 @@
     "CONTRIBUTING.*"
   ],
   "scripts": {
-    "test" : "grunt dev && grunt karma:single"
+    "test" : "grunt dev && grunt karma:single",
+    "lint" : "grunt check"
   }
 }

+ 12 - 2
tests/automated/refetchEvents.js

@@ -91,7 +91,11 @@ describe('refetchEvents', function() {
 				// set a 100ms timeout on this event source
 				options.eventSources[0].events = function(start, end, timezone, callback) {
 					var events = [
-						{ id: '1', start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A', className: 'fetch' + fetchCount }
+						{ id: '1',
+						  start: '2015-08-07T02:00:00',
+						  end: '2015-08-07T03:00:00',
+						  title: 'event A', className: 'fetch' + fetchCount
+						}
 					];
 
 					setTimeout(function() {
@@ -123,7 +127,13 @@ describe('refetchEvents', function() {
 		function createEventGenerator() {
 			return function(start, end, timezone, callback) {
 				var events = [
-					{ id: 1, start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A', className: 'fetch' + fetchCount }
+					{
+					  id: 1,
+					  start: '2015-08-07T02:00:00',
+					  end: '2015-08-07T03:00:00',
+					  title: 'event A',
+					  className: 'fetch' + fetchCount
+					}
 				];
 
 				callback(events);

+ 7 - 7
tests/automated/removeEventSource.js

@@ -56,21 +56,21 @@ describe('removeEventSource', function() {
 
 		var source1 = function(start, end, timezone, callback) {
 			setTimeout(function() {
-				callback([{
+				callback([ {
 					title: 'event1',
 					className: 'event1',
 					start: '2014-08-01T02:00:00'
-				}]);
+				} ]);
 			}, 100);
 		};
 
 		var source2 = function(start, end, timezone, callback) {
 			setTimeout(function() {
-				callback([{
+				callback([ {
 					title: 'event2',
 					className: 'event2',
 					start: '2014-08-01T02:00:00'
-				}]);
+				} ]);
 			}, 100);
 		};
 
@@ -94,10 +94,10 @@ describe('removeEventSource', function() {
 
 	describe('when multiple sources share the same fetching function', function() {
 		var fetchFunc = function(start, end, timezone, callback) {
-			callback([{
+			callback([ {
 				title: 'event',
 				start: '2014-08-01T02:00:00'
-			}]);
+			} ]);
 		};
 		beforeEach(function() {
 			options.eventSources = [
@@ -192,4 +192,4 @@ describe('removeEventSource', function() {
 		expect($('.fc-event').length).toBe(cnt);
 		expect($('#cal').fullCalendar('clientEvents').length).toBe(cnt);
 	}
-});
+});

+ 2 - 2
tests/automated/removeEventSources.js

@@ -41,11 +41,11 @@ describe('removeEventSources', function() {
 		return {
 			id: id,
 			events: function(start, end, timezone, callback) {
-				callback([{
+				callback([ {
 					title: 'event' + id,
 					className: 'event' + id,
 					start: '2014-08-01T02:00:00'
-				}]);
+				} ]);
 			}
 		};
 	}