From ecd8ddea33dc40ae2a57e4340be03faf2ba2f99b Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 1 Aug 2017 09:52:45 -0700 Subject: Tests: Add support for running unit tests via grunt with karma - Update QUnit to 1.23.1 - Remove unused dl#dl from test/index.html - Remove unused map#imgmap from test/index.html - Ensure all urls to data use baseURI - Add the 'grunt karma:main' task - customContextFile & customDebugFile - Add 'npm run jenkins' script Close gh-3744 Fixes gh-1999 --- build/tasks/qunit_fixture.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 build/tasks/qunit_fixture.js (limited to 'build') diff --git a/build/tasks/qunit_fixture.js b/build/tasks/qunit_fixture.js new file mode 100644 index 000000000..ebf0b220c --- /dev/null +++ b/build/tasks/qunit_fixture.js @@ -0,0 +1,22 @@ +var fs = require( "fs" ); + +module.exports = function( grunt ) { + grunt.registerTask( "qunit_fixture", function() { + var dest = "./test/data/qunit-fixture.js"; + fs.writeFileSync( + dest, + "// Generated by build/tasks/qunit_fixture.js\n" + + "QUnit.config.fixture = " + + JSON.stringify( + fs.readFileSync( + "./test/data/qunit-fixture.html", + "utf8" + ).toString() + ) + + ";\n" + + "// Compat with QUnit 1.x:\n" + + "document.getElementById( \"qunit-fixture\" ).innerHTML = QUnit.config.fixture;\n" + ); + grunt.log.ok( "Updated " + dest + "." ); + } ); +}; -- cgit v1.2.3