Skip to content

Commit

Permalink
Merge pull request #4 from hpcloud/install-karma
Browse files Browse the repository at this point in the history
Installing Karma
  • Loading branch information
ongk committed Jan 8, 2016
2 parents ab63857 + ab2db20 commit 9668eb6
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
**/.*/*
npm-debug.log
node_modules
dist
Expand Down
10 changes: 10 additions & 0 deletions src/app/app.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(function () {
'use strict';

describe('app', function () {
it('should', function () {
expect(true).toBe(true);
});
});

})();
60 changes: 60 additions & 0 deletions tools/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

module.exports = function (config) {

config.set({

autoWatch: true,

basePath: '../src/',

browsers: ['PhantomJS'],

coverageReporter: {
type: 'html',
dir: '../tools/.coverage-karma/'
},

files: [
'config.js',

'lib/angular/angular.min.js',
'lib/helion-ui-framework/**/*.module.js',
'lib/helion-ui-framework/**/!(*.mock|*.spec).js',
'lib/helion-ui-framework/**/!(*.mock).html',

'index.module.js',
'app/**/*.module.js',
'app/**/!(*.mock|*.spec).js',
'app/**/*.mock.js',
'app/**/*.spec.js',
'app/**/*.html'
],

frameworks: ['jasmine'],

ngHtml2JsPreprocessor: {
moduleName: 'templates'
},

phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},

plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage'
],

preprocessors: {
'app/**/*.html': ['ng-html2js'],
'app/**/!(*.mock|*.spec).js': ['coverage']
},

reporters: ['progress', 'coverage']
});
};
10 changes: 10 additions & 0 deletions tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@
"gulp-inject": "^3.0.0",
"gulp-sass": "^2.1.1",
"run-sequence": "^1.1.5"
},
"devDependencies": {
"jasmine-core": "^2.4.1",
"karma": "^0.13.19",
"karma-cli": "^0.1.2",
"karma-coverage": "^0.5.3",
"karma-jasmine": "^0.3.6",
"karma-ng-html2js-preprocessor": "^0.2.0",
"karma-phantomjs-launcher": "^0.2.3",
"phantomjs": "^1.9.19"
}
}

0 comments on commit 9668eb6

Please sign in to comment.