Skip to content

Commit

Permalink
feat(tests): adds tests, initial configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wzr1337 committed Apr 4, 2015
1 parent cec7e1e commit a26c690
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo/app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ angular.module('angularGesturesDemoApp', ['angular-gestures', 'ngRoute'])
});
hammerDefaultOptsProvider.set({
recognizers: [
[Hammer.Tap],
[Hammer.Tap,{ event: 'tap'}],
[Hammer.Tap, { event: 'doubletap', taps: 2 }, [], ['tap']],
[Hammer.Press],
[Hammer.Pan]
]
Expand Down
12 changes: 12 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var gulp = require('gulp');
var karma = require('karma').server;

/**
* Run test once and exit
*/
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
67 changes: 67 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Karma configuration
// Generated on Sat Apr 04 2015 10:33:04 GMT+0200 (CEST)

module.exports = function(config) {
config.set({

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


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


// list of files / patterns to load in the browser
files: [
'components/**/*.min.js', // dependecies
'src/**/*.js',
'test/**/*.Spec.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
"grunt-contrib-jshint": "~0.3.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "^0.6.1",
"gulp": "^3.8.11",
"gulp-karma": "0.0.4",
"jasmine-core": "^2.2.0",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.7",
"karma-cli": "0.0.4",
"karma-jasmine": "^0.3.5",
"load-grunt-tasks": "^1.0.0",
"matchdep": "~0.1.1",
"time-grunt": "^1.0.0"
Expand Down
5 changes: 5 additions & 0 deletions test/gestures.Spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});

0 comments on commit a26c690

Please sign in to comment.