Skip to content

Commit 41f1b5c

Browse files
committed
Merge commit '2247a361c29df03b137b5bdd7b94a646a6db04d8'
2 parents f990b71 + 2247a36 commit 41f1b5c

File tree

5 files changed

+75
-52
lines changed

5 files changed

+75
-52
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
3+
before_script:
4+
- npm install -g grunt-cli
5+
- npm install -g bower
6+
- bower install
7+
- npm install
8+
9+
script:
10+
- npm run build
11+
- npm test

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ gridstack.js
22
============
33

44
[![Build Status](https://travis-ci.org/troolee/gridstack.js.svg?branch=master)](https://travis-ci.org/troolee/gridstack.js)
5+
[![Coverage Status](https://coveralls.io/repos/github/troolee/gridstack.js/badge.svg?branch=master)](https://coveralls.io/github/troolee/gridstack.js?branch=master)
56

67
gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
78
draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com), [angular.js](https://angularjs.org) and touch devices.

karma.conf.js

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,78 @@
22
// Generated on Thu Feb 18 2016 22:00:23 GMT+0100 (CET)
33

44
module.exports = function(config) {
5-
config.set({
5+
config.set({
66

7-
// base path that will be used to resolve all patterns (eg. files, exclude)
8-
basePath: '',
7+
// base path that will be used to resolve all patterns (eg. files, exclude)
8+
basePath: '',
99

1010

11-
// frameworks to use
12-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13-
frameworks: ['jasmine'],
11+
// frameworks to use
12+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13+
frameworks: ['jasmine'],
1414

1515

16-
// list of files / patterns to load in the browser
17-
files: [
18-
'bower_components/jquery/dist/jquery.min.js',
19-
'bower_components/jquery-ui/jquery-ui.min.js',
20-
'bower_components/lodash/dist/lodash.min.js',
21-
'src/gridstack.js',
22-
'spec/*-spec.js'
23-
],
16+
// list of files / patterns to load in the browser
17+
files: [
18+
'bower_components/jquery/dist/jquery.min.js',
19+
'bower_components/jquery-ui/jquery-ui.min.js',
20+
'bower_components/lodash/dist/lodash.min.js',
21+
'src/gridstack.js',
22+
'spec/*-spec.js'
23+
],
2424

2525

26-
// list of files to exclude
27-
exclude: [
28-
],
26+
// list of files to exclude
27+
exclude: [
28+
],
2929

3030

31-
// preprocess matching files before serving them to the browser
32-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
33-
preprocessors: {
34-
'src/gridstack.js': ['coverage']
35-
},
31+
// preprocess matching files before serving them to the browser
32+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
33+
preprocessors: {
34+
'src/gridstack.js': ['coverage']
35+
},
3636

3737

38-
// test results reporter to use
39-
// possible values: 'dots', 'progress'
40-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
41-
reporters: ['progress', 'coverage'],
38+
// test results reporter to use
39+
// possible values: 'dots', 'progress'
40+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
41+
reporters: ['progress', 'coverage', 'coveralls'],
4242

43+
coverageReporter: {
44+
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
45+
dir: 'coverage/'
46+
},
4347

44-
// web server port
45-
port: 9876,
48+
// web server port
49+
port: 9876,
4650

4751

48-
// enable / disable colors in the output (reporters and logs)
49-
colors: true,
52+
// enable / disable colors in the output (reporters and logs)
53+
colors: true,
5054

5155

52-
// level of logging
53-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
54-
logLevel: config.LOG_INFO,
56+
// level of logging
57+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN
58+
// config.LOG_INFO || config.LOG_DEBUG
59+
logLevel: config.LOG_INFO,
5560

5661

57-
// enable / disable watching file and executing tests whenever any file changes
58-
autoWatch: true,
62+
// enable / disable watching file and executing tests whenever any file changes
63+
autoWatch: true,
5964

6065

61-
// start these browsers
62-
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63-
browsers: ['PhantomJS'],
66+
// start these browsers
67+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
68+
browsers: ['PhantomJS'],
6469

6570

66-
// Continuous Integration mode
67-
// if true, Karma captures browsers, runs the tests and exits
68-
singleRun: false,
71+
// Continuous Integration mode
72+
// if true, Karma captures browsers, runs the tests and exits
73+
singleRun: true,
6974

70-
// Concurrency level
71-
// how many browser should be started simultaneous
72-
concurrency: Infinity
73-
})
75+
// Concurrency level
76+
// how many browser should be started simultaneous
77+
concurrency: Infinity
78+
});
7479
}

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"type": "git",
88
"url": "git+https://github.com/troolee/gridstack.js.git"
99
},
10+
"scripts": {
11+
"build": "grunt",
12+
"test": "karma start karma.conf.js"
13+
},
1014
"keywords": [
1115
"gridstack",
1216
"grid",
@@ -21,21 +25,23 @@
2125
},
2226
"homepage": "http://troolee.github.io/gridstack.js/",
2327
"devDependencies": {
28+
"coveralls": "^2.11.6",
2429
"grunt": "^0.4.5",
2530
"grunt-contrib-copy": "^0.8.2",
2631
"grunt-contrib-cssmin": "^0.14.0",
2732
"grunt-contrib-jshint": "^1.0.0",
2833
"grunt-contrib-uglify": "^0.10.1",
34+
"grunt-contrib-watch": "^0.6.1",
2935
"grunt-doctoc": "^0.1.1",
36+
"grunt-jscs": "^2.7.0",
3037
"grunt-sass": "^1.1.0",
3138
"jasmine-core": "^2.4.1",
3239
"karma": "^0.13.21",
3340
"karma-coverage": "^0.5.3",
41+
"karma-coveralls": "^1.1.2",
3442
"karma-jasmine": "^0.3.7",
3543
"karma-phantomjs-launcher": "^1.0.0",
3644
"phantomjs": "^2.1.3",
37-
"phantomjs-prebuilt": "^2.1.4",
38-
"grunt-contrib-watch": "^0.6.1",
39-
"grunt-jscs": "^2.7.0"
45+
"phantomjs-prebuilt": "^2.1.4"
4046
}
4147
}

spec/gridstack-spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ describe('gridstack', function() {
7373

7474
it('should sort ascending without width.', function() {
7575
w.width = false;
76-
w.nodes = [{x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}, {x: 0, y: 1}];
76+
w.nodes = [{x: 7, y: 0, width: 1}, {x: 4, y: 4, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}];
7777
e.prototype._sortNodes.call(w, 1);
78-
expect(w.nodes).toEqual([{x: 0, y: 1}, {x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}]);
78+
expect(w.nodes).toEqual([{x: 7, y: 0, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}, {x: 4, y: 4, width: 1}]);
7979
});
8080

8181
it('should sort descending without width.', function() {
8282
w.width = false;
83-
w.nodes = [{x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}, {x: 0, y: 1}];
83+
w.nodes = [{x: 7, y: 0, width: 1}, {x: 4, y: 4, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}];
8484
e.prototype._sortNodes.call(w, -1);
85-
expect(w.nodes).toEqual([{x: 9, y: 0}, {x: 4, y: 4}, {x: 7, y: 0}, {x: 0, y: 1}]);
85+
expect(w.nodes).toEqual([{x: 4, y: 4, width: 1}, {x: 0, y: 1, width: 1}, {x: 9, y: 0, width: 1}, {x: 7, y: 0, width: 1}]);
8686
});
8787

8888
});

0 commit comments

Comments
 (0)