Merge more testing coverage from henrikingo fork

* core_tests.js and navigation_tests.js have more tests
* qunit_test_runner.html runs QUnit in a browser (without karma) and
  provides a generic iframe based platform to test different  presentations.
* copy qunit.js and syn.js into the repo. This allows qunit_test_runner.html
  to work without any dependency on node/npm. (Karma obviously does need them.)
* Move jscs cli option to .jscsrc instead
This commit is contained in:
Henrik Ingo
2017-09-16 13:08:51 +03:00
parent 0b4bd08f44
commit 7aaea7fd37
12 changed files with 7511 additions and 156 deletions

33
test/bootstrap.js vendored
View File

@@ -1,12 +1,25 @@
/*jshint browser:true */
var root = document.createElement( "div" );
root.innerHTML = [
"<div id='impress'>",
" <div class='step' data-x='-1000' data-y='0'>First slide</div>",
" <div class='step' data-x='-800' data-y='0'>Second slide</div>",
" <div class='step' data-x='-600' data-y='0'>Third slide</div>",
" <div class='step' data-x='-400' data-y='0'>Fourth slide</div>",
"</div>"
].join( "" );
document.body.appendChild( root );
// TODO: This is the bootstrap file for *karma*. Poorly named (since karma is
// only one option, in this repo) but keeping the same name now to avoid
// unnecessary deviation with upstream.
// If you just want to run the tests locally, you can open test/index.html in Firefox.
// That's annoying: karma-qunit doesn't provide the qunit-fixture element
// https://github.com/karma-runner/karma-qunit/issues/18
// This file contains so much HTML, that we will just respectfully disagree about js
/* jshint quotmark:single */
/* global document */
var fix = document.createElement( 'div' );
fix.id = 'qunit-fixture';
fix.innerHTML = [
'\n',
' <iframe id="presentation-iframe"\n',
' src="SET THIS IN YOUR QUNIT TESTS"\n',
' width="595" height="485"\n',
' frameborder="0" marginwidth="0" marginheight="0" scrolling="no"\n',
' style="border:1px solid #CCC; max-width: 100%;">\n',
' </iframe>'
].join( '' );