add test task, avoid attempt to run tests in unrelated html files
authorHakim El Hattab <hakim.elhattab@gmail.com>
Sat, 24 Aug 2013 14:52:35 +0000 (10:52 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Sat, 24 Aug 2013 14:52:35 +0000 (10:52 -0400)
Gruntfile.js
package.json
test/test.js

index 5daa4e56c3c4e971b802d3345c304355974a33a6..4df3181eb9bdb1d81a46b9fd45ae78d395430495 100644 (file)
@@ -17,7 +17,7 @@ module.exports = function(grunt) {
 
                // Tests will be added soon
                qunit: {
-                       files: [ 'test/**/*.html' ]
+                       files: [ 'test/*.html' ]
                },
 
                uglify: {
@@ -130,4 +130,7 @@ module.exports = function(grunt) {
        // Serve presentation locally
        grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
 
+       // Run tests
+       grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );
+
 };
index 2c7036eb2926e78b33165f9e31a856caac29e764..caef3f9d91df1050f7c3fd7a3a6f1b0fcaabcfa4 100644 (file)
@@ -5,7 +5,7 @@
   "homepage": "http://lab.hakim.se/reveal-js",
   "subdomain": "revealjs",
   "scripts": {
-    "test": "grunt jshint qunit",
+    "test": "grunt test",
     "start": ""
   },
   "author": {
index 08c5c37e8fcb127848b4e6875e2356f7eb5103dd..00c96227cbe57bdc1a85e34644635f3c302dfaec 100644 (file)
@@ -206,7 +206,6 @@ Reveal.addEventListener( 'ready', function() {
 
        asyncTest( 'fragmentshown event', function() {
                expect( 2 );
-               start();
 
                var _onEvent = function( event ) {
                        ok( true, 'event fired' );
@@ -221,6 +220,8 @@ Reveal.addEventListener( 'ready', function() {
                Reveal.next();
                Reveal.prev(); // shouldn't fire fragmentshown
 
+               start();
+
                Reveal.removeEventListener( 'fragmentshown', _onEvent );
        });