Skip to content

Commit

Permalink
Merge pull request OwlCarousel2#907 from smashingboxes/add-blanket-co…
Browse files Browse the repository at this point in the history
…verage-analysis

Build: Adds blanket.js to provide test coverage information at build time (Ref OwlCarousel2#906)
  • Loading branch information
greg5green committed Jul 1, 2015
2 parents d30ef15 + ccdd41e commit 6adfc91
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ module.exports = function(grunt) {
},

qunit: {
dist: [ 'test/*.html' ]
dist: [ 'test/index.html' ]
},

blanket_qunit: {
dist: {
options: {
urls: [ 'test/index.html?coverage&gruntReport' ],
threshold: 0
}
}
},

jscs: {
Expand Down Expand Up @@ -248,7 +257,6 @@ module.exports = function(grunt) {
},
js: {
files: [ 'src/**/*.js' ],

tasks: [ 'jscs:dist', 'jshint:dist', 'qunit:dist', 'concat:dist', 'uglify:dist', 'usebanner:dist', 'copy:distToDocs', 'copy:srcToDocs' ]
},
helpersDocs: {
Expand Down Expand Up @@ -292,7 +300,7 @@ module.exports = function(grunt) {

grunt.registerTask('docs', [ 'dist', 'clean:docs', 'assemble', 'sass:docs', 'copy:docsAssets', 'copy:distToDocs', 'zip' ]);

grunt.registerTask('test', [ 'jshint:dist', 'qunit:dist' ]);
grunt.registerTask('test', [ 'jshint:dist', 'qunit:dist', 'blanket_qunit:dist' ]);

grunt.registerTask('default', [ 'dist', 'docs', 'test' ]);

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
},
"devDependencies": {
"assemble": "~0.4.37",
"blanket": "^1.1.7",
"foundation-sites": "~5.5.2",
"grunt": "~0.4.5",
"grunt-banner": "^0.4.0",
"grunt-blanket-qunit": "^0.2.0",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-compress": "~0.13.0",
"grunt-contrib-concat": "~0.5.1",
Expand Down
12 changes: 9 additions & 3 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@

<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/blanket/dist/qunit/blanket.js"></script>
<script>
if (location.href.match(/(\?|&)gruntReport($|&|=)/)) {
blanket.options("reporter", "../node_modules/grunt-blanket-qunit/reporter/grunt-reporter.js");
}
</script>

<script src="../src/js/owl.carousel.js"></script>
<script src="../src/js/owl.support.js"></script>
<script src="../src/js/owl.carousel.js" data-cover></script>
<script src="../src/js/owl.support.js" data-cover></script>
<script src="unit/core.js"></script>
</head>
<body>
Expand All @@ -27,4 +33,4 @@

</div>
</body>
</html>
</html>

0 comments on commit 6adfc91

Please sign in to comment.