Skip to content

Commit 464a8e8

Browse files
committed
Added travis
1 parent 42bb51b commit 464a8e8

File tree

4 files changed

+65
-49
lines changed

4 files changed

+65
-49
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

karma.conf.js

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,74 @@
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'],
4242

4343

44-
// web server port
45-
port: 9876,
44+
// web server port
45+
port: 9876,
4646

4747

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

5151

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,
52+
// level of logging
53+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN
54+
// config.LOG_INFO || config.LOG_DEBUG
55+
logLevel: config.LOG_INFO,
5556

5657

57-
// enable / disable watching file and executing tests whenever any file changes
58-
autoWatch: true,
58+
// enable / disable watching file and executing tests whenever any file changes
59+
autoWatch: true,
5960

6061

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

6566

66-
// Continuous Integration mode
67-
// if true, Karma captures browsers, runs the tests and exits
68-
singleRun: false,
67+
// Continuous Integration mode
68+
// if true, Karma captures browsers, runs the tests and exits
69+
singleRun: true,
6970

70-
// Concurrency level
71-
// how many browser should be started simultaneous
72-
concurrency: Infinity
73-
})
71+
// Concurrency level
72+
// how many browser should be started simultaneous
73+
concurrency: Infinity
74+
});
7475
}

package.json

Lines changed: 4 additions & 0 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",

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)