add test task, avoid attempt to run tests in unrelated html files
This commit is contained in:
parent
7f85c21386
commit
1c8fd60595
@ -17,7 +17,7 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
// Tests will be added soon
|
// Tests will be added soon
|
||||||
qunit: {
|
qunit: {
|
||||||
files: [ 'test/**/*.html' ]
|
files: [ 'test/*.html' ]
|
||||||
},
|
},
|
||||||
|
|
||||||
uglify: {
|
uglify: {
|
||||||
@ -130,4 +130,7 @@ module.exports = function(grunt) {
|
|||||||
// Serve presentation locally
|
// Serve presentation locally
|
||||||
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
|
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
|
||||||
|
|
||||||
|
// Run tests
|
||||||
|
grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"homepage": "http://lab.hakim.se/reveal-js",
|
"homepage": "http://lab.hakim.se/reveal-js",
|
||||||
"subdomain": "revealjs",
|
"subdomain": "revealjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "grunt jshint qunit",
|
"test": "grunt test",
|
||||||
"start": ""
|
"start": ""
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -206,7 +206,6 @@ Reveal.addEventListener( 'ready', function() {
|
|||||||
|
|
||||||
asyncTest( 'fragmentshown event', function() {
|
asyncTest( 'fragmentshown event', function() {
|
||||||
expect( 2 );
|
expect( 2 );
|
||||||
start();
|
|
||||||
|
|
||||||
var _onEvent = function( event ) {
|
var _onEvent = function( event ) {
|
||||||
ok( true, 'event fired' );
|
ok( true, 'event fired' );
|
||||||
@ -221,6 +220,8 @@ Reveal.addEventListener( 'ready', function() {
|
|||||||
Reveal.next();
|
Reveal.next();
|
||||||
Reveal.prev(); // shouldn't fire fragmentshown
|
Reveal.prev(); // shouldn't fire fragmentshown
|
||||||
|
|
||||||
|
start();
|
||||||
|
|
||||||
Reveal.removeEventListener( 'fragmentshown', _onEvent );
|
Reveal.removeEventListener( 'fragmentshown', _onEvent );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user