Skip to content

Instantly share code, notes, and snippets.

@ppcano
Created December 6, 2011 15:18
Show Gist options
  • Save ppcano/1438537 to your computer and use it in GitHub Desktop.
Save ppcano/1438537 to your computer and use it in GitHub Desktop.
SC unit test
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>QUnit Test Runner</title>
<link rel="stylesheet" type="text/css" href="assets/qunit/qunit_styles.css" />
<link rel="stylesheet" type="text/css" href="assets/bpm_styles.css" />
</head>
<body>
<h1 id="qunit-header"></h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
<!-- IE8 wants the script tag to be in the body. For more info, Google: KB927917 -->
<script src="assets/bpm_libs.js" type="text/javascript"></script>
<script src="assets/qunit/qunit_libs.js" type="text/javascript"></script>
<script src="assets/bpm_libs.js" type="text/javascript"></script>
<script src="assets/sc-uikit/bpm_tests.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
/*globals spade */
//var match = /^sc-uikit\/~tests/;
//var match =/~tests/; // all
//var match =/~tests\/[A-Za-z0-9-_]+_test/; // only on tests directory
var match =/~tests\/[^\n]+_test/; // only on tests directory
//var unique_test = "sc-uikit/~tests/client/collection_view_works_with_live_items_controller_test";
var unique_test = "sc-uikit/~tests/touch/collection_view_should_respond_to_test_event";
//var unique_test = "sc-uikit/~tests/touch/collection_view_not_respond_to_events_test";
// var unique_test = null; // to test ALL
if ( !unique_test ) {
for(var moduleId in spade._factories) {
//console.log( moduleId );
if (moduleId.match(match)) {
//console.log( ' match ============ ' );
spade.require(moduleId);
}
}
} else {
//console.log( unique_test );
spade.require(unique_test);
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment