Skip to content
Permalink
Browse files

Adding coverage.

  • Loading branch information...
vlamanna committed Nov 14, 2013
1 parent 1183dfb commit 2d1fc73e0ebe94275c93d04bf6e4b5a9c14291a3
Showing with 54 additions and 12 deletions.
  1. +1 −0 .coveralls.yml
  2. +1 −0 .gitignore
  3. +13 −3 Gruntfile.js
  4. +1 −1 js/.jshintrc
  5. +3 −0 js/tests/fixture.js
  6. +2 −7 js/tests/index.html
  7. +26 −0 karma.conf.js
  8. +7 −1 package.json
@@ -0,0 +1 @@
repo_token: TdGiaWg5Yf8V3dgRpmsf8wDfAIAjbjyfd
@@ -1,6 +1,7 @@
.DS_Store
nbproject/*
node_modules
coverage
dev-select.html
dev-countries.html
dev-datepicker.html
@@ -90,8 +90,16 @@ module.exports = function(grunt) {
}
},

qunit: {
files: ['js/tests/*.html']
karma: {
test: {
configFile: 'karma.conf.js'
}
},

coveralls: {
options: {
coverage_dir: 'coverage'
}
},

watch: {
@@ -120,8 +128,10 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');

grunt.registerTask('test', ['dist-css', 'jshint', 'qunit']);
grunt.registerTask('test', ['dist-css', 'jshint', 'karma', 'coveralls']);

// JS distribution task.
grunt.registerTask('dist-js', ['concat', 'uglify']);
@@ -6,7 +6,7 @@

// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
@@ -0,0 +1,3 @@
$(document).ready( function () {
$(document).find('body').append('<div id="qunit-fixture"></div>');
});
@@ -52,12 +52,7 @@

</head>
<body>
<div>
<h1 id="qunit-header">Bootstrap Form Helpers Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
</div>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>
@@ -0,0 +1,26 @@
module.exports = function(config) {
config.set({
basePath: '',
autoWatch: true,
frameworks: ['qunit'],
files: [
'js/tests/vendor/js/jquery-1.10.2.js',
'js/tests/fixture.js',
'js/tests/vendor/js/bootstrap-3.0.0.min.js',
'js/lang/en_US/*.js',
'js/*.js',
'js/tests/unit/*.js'
],
browsers: ['PhantomJS'],

reporters: ['progress', 'coverage'],
preprocessors: { 'js/*.js': ['coverage'] },

singleRun: true,

coverageReporter: {
type: "lcov",
dir: "coverage/"
}
});
};
@@ -30,6 +30,12 @@
"grunt-contrib-qunit": "~0.3.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-recess": "~0.4.0"
"grunt-recess": "~0.4.0",
"grunt-karma": "~0.6.2",
"karma": "~0.10.2",
"karma-qunit": "~0.1.1",
"karma-coverage": "~0.1.0",
"coveralls": "~2.3.0",
"grunt-karma-coveralls": "~2.0.2"
}
}

0 comments on commit 2d1fc73

Please sign in to comment.
You can’t perform that action at this time.