Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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
- Loading branch information
Showing
with
3,399 additions
and 2,692 deletions.
- +2 −0 .travis.yml
- +84 −0 Gruntfile.js
- +5 −5 README.md
- +22 −0 build/tasks/qunit_fixture.js
- +8 −4 external/qunit/qunit.css
- +2,160 −1,984 external/qunit/qunit.js
- +12 −4 package.json
- +0 −5 test/data/ajax/content-type.php
- +0 −1 test/data/ajax/evalScript.php
- +0 −1 test/data/ajax/method.php
- +1 −1 test/data/ajax/unreleasedXHR.html
- +0 −4 test/data/atom+xml.php
- +0 −3 test/data/core/dont_return.php
- +1 −1 test/data/core/dynamic_ready.html
- +14 −0 test/data/csp.include.html
- +0 −1 test/data/echoData.php
- +0 −1 test/data/echoQuery.php
- +0 −6 test/data/errorWithJSON.php
- +0 −5 test/data/errorWithText.php
- +0 −24 test/data/etag.php
- +1 −1 test/data/event/interactiveReady.html
- +1 −1 test/data/event/syncReady.html
- +0 −23 test/data/headers.php
- +0 −20 test/data/if_modified_since.php
- +0 −13 test/data/json.php
- +0 −14 test/data/jsonp.php
- +0 −4 test/data/longLoadScript.php
- +244 −0 test/data/mock.php
- +0 −24 test/data/name.php
- +0 −5 test/data/nocontent.php
- +0 −12 test/data/params_html.php
- +237 −0 test/data/qunit-fixture.html
- +4 −0 test/data/qunit-fixture.js
- +0 −11 test/data/script.php
- +0 −5 test/data/statusText.php
- +0 −3 test/data/support/csp-clean.php
- +0 −3 test/data/support/csp-log.php
- +0 −19 test/data/support/csp.php
- +2 −2 test/data/{test.html → test.include.html}
- +0 −7 test/data/test.php
- +0 −3 test/data/testbar.php
- +25 −12 test/data/testinit.js
- 0 test/data/{text.php → text.txt}
- +0 −7 test/data/with_fries_over_jsonp.php
- +2 −245 test/index.html
- +45 −0 test/karma.context.html
- +47 −0 test/karma.debug.html
- +284 −0 test/middleware-mockserver.js
- +171 −179 test/unit/ajax.js
- +2 −2 test/unit/attributes.js
- +3 −3 test/unit/basic.js
- +3 −3 test/unit/core.js
- +2 −3 test/unit/css.js
- +1 −1 test/unit/data.js
- +1 −1 test/unit/effects.js
- +2 −3 test/unit/event.js
- +2 −2 test/unit/manipulation.js
- +3 −3 test/unit/offset.js
- +3 −3 test/unit/support.js
- +5 −5 test/unit/traversing.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 + "." ); | ||
} ); | ||
}; |
Oops, something went wrong.