@@ -115,7 +115,6 @@ module.exports = function(grunt) {
115115 'cssmin' ,
116116 'imagemin' ,
117117 'jshint' ,
118- 'qunit' ,
119118 'uglify' ,
120119 'watch'
121120 ] ,
@@ -957,7 +956,8 @@ module.exports = function(grunt) {
957956 src : [
958957 'tests/qunit/**/*.js' ,
959958 '!tests/qunit/vendor/*' ,
960- '!tests/qunit/editor/**'
959+ '!tests/qunit/qunit.js' ,
960+ '!tests/qunit/playwright.config.js'
961961 ] ,
962962 options : grunt . file . readJSON ( 'tests/qunit/.jshintrc' )
963963 } ,
@@ -1061,12 +1061,6 @@ module.exports = function(grunt) {
10611061 }
10621062 }
10631063 } ,
1064- qunit : {
1065- files : [
1066- 'tests/qunit/**/*.html' ,
1067- '!tests/qunit/editor/**'
1068- ]
1069- } ,
10701064 phpunit : {
10711065 'default' : {
10721066 args : [ '--verbose' , '-c' , 'phpunit.xml.dist' ]
@@ -1599,8 +1593,7 @@ module.exports = function(grunt) {
15991593 } ,
16001594 test : {
16011595 files : [
1602- 'tests/qunit/**' ,
1603- '!tests/qunit/editor/**'
1596+ 'tests/qunit/**'
16041597 ] ,
16051598 tasks : [ 'qunit' ]
16061599 }
@@ -2222,6 +2215,20 @@ module.exports = function(grunt) {
22222215 } , this . async ( ) ) ;
22232216 } ) ;
22242217
2218+ grunt . registerTask ( 'qunit' , 'Runs QUnit tests.' , function ( ) {
2219+ var done = this . async ( ) ;
2220+ grunt . util . spawn ( {
2221+ cmd : 'npx' ,
2222+ args : [ 'playwright' , 'test' , '--config' , 'tests/qunit/playwright.config.js' ] ,
2223+ opts : { stdio : 'inherit' }
2224+ } , function ( error , result , code ) {
2225+ if ( code !== 0 ) {
2226+ grunt . fail . warn ( 'QUnit tests failed.' ) ;
2227+ }
2228+ done ( ) ;
2229+ } ) ;
2230+ } ) ;
2231+
22252232 grunt . registerTask ( 'qunit:compiled' , 'Runs QUnit tests on compiled as well as uncompiled scripts.' ,
22262233 [ 'build' , 'copy:qunit' , 'qunit' ]
22272234 ) ;
0 commit comments