Permalink
Browse files

Unignored tests and updated test themes to work with latest alpha

  • Loading branch information...
1 parent 8725ed1 commit aa8c0d921b2b8fbf1d74841324c5518fa6c01217 @IanLunn committed Jan 16, 2015
View
@@ -5,4 +5,3 @@ node_modules
tmp
.tmp
bower_components
-tests
View
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Jasmine Spec Runner v2.0.0</title>
+
+ <link rel="shortcut icon" type="image/png" href="scripts/jasmine-2.0.0/jasmine_favicon.png">
+ <link rel="stylesheet" type="text/css" href="scripts/jasmine-2.0.0/jasmine.css">
+
+ <script type="text/javascript" src="scripts/jasmine-2.0.0/jasmine.js"></script>
+ <script type="text/javascript" src="scripts/jasmine-2.0.0/jasmine-html.js"></script>
+ <script type="text/javascript" src="scripts/jasmine-2.0.0/boot.js"></script>
+
+
+ <style>
+ #sequence {
+ position: relative;
+ height: 185px;
+ width: 100%;
+ max-width: 400px;
+ margin: 0 auto;
+ padding: 0;
+ border: black solid 2px;
+ font-family: sans-serif;
+ }
+
+ #sequence .sequence-screen,
+ #sequence .sequence-canvas,
+ #sequence .sequence-canvas > * {
+ position: absolute;
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ }
+
+ #sequence .box {
+ position: absolute;
+ height: 100px;
+ width: 100px;
+ border: red solid 1px;
+ left: 100%;
+ -webkit-transition-duration: .5s;
+ transition-duration: .5s;
+ }
+
+ #sequence .animate-in .box {
+ left: 50%;
+ margin-left: -50px;
+ }
+
+ #sequence .animate-out .box {
+ left: 0;
+ margin-left: -100px;
+ }
+ </style>
+</head>
+
+<body>
+
+ <button class="sequence-prev">Prev</button>
+ <button id="pause" class="sequence-pause">Pause</button>
+ <button id="next" class="sequence-next custom-next">Next</button>
+
+ <div class="sequence-pagination">
+ <button>1</button>
+ <button>2</button>
+ <button>3</button>
+ </div>
+
+ <div id="sequence">
+ <div class="sequence-screen">
+ <ul class="sequence-canvas">
+ <li id="step1">
+ <div class="box box1">Box 1</div>
+ </li>
+ <li id="step2">
+ <div class="box box2">Box 2</div>
+ </li>
+ <li id="step3">
+ <div class="box box3">Box 3</div>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <script src="../scripts/imagesloaded.pkgd.min.js"></script>
+ <script src="../scripts/hammer.min.js"></script>
+ <script src="../scripts/sequence.js"></script>
+ <script>
+
+ var sequenceElement = document.getElementById("sequence");
+ var mySequence = sequence(sequenceElement);
+ </script>
+
+ <script type="text/javascript" src="spec/sequence_spec.js"></script>
+</body>
+</html>
View
@@ -0,0 +1,5 @@
+<ul>
+ <li><a href="specRunner.html">Spec Runner<a/></li>
+ <li><a href="themes/test-theme/">Test Theme<a/> - Tests Init/Destroy, Hash Tags</li>
+ <li><a href="themes/multiple-test/">Multiple Instances Test<a/> - Tests multiple instances, global/relative UI elements</li>
+</ul>
@@ -0,0 +1,181 @@
+/**
+ Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
+
+ If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
+
+ The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
+
+ [jasmine-gem]: http://github.com/pivotal/jasmine-gem
+ */
+
+(function() {
+
+ /**
+ * ## Require &amp; Instantiate
+ *
+ * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
+ */
+ window.jasmine = jasmineRequire.core(jasmineRequire);
+
+ /**
+ * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
+ */
+ jasmineRequire.html(jasmine);
+
+ /**
+ * Create the Jasmine environment. This is used to run all specs in a project.
+ */
+ var env = jasmine.getEnv();
+
+ /**
+ * ## The Global Interface
+ *
+ * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
+ */
+ var jasmineInterface = {
+ describe: function(description, specDefinitions) {
+ return env.describe(description, specDefinitions);
+ },
+
+ xdescribe: function(description, specDefinitions) {
+ return env.xdescribe(description, specDefinitions);
+ },
+
+ it: function(desc, func) {
+ return env.it(desc, func);
+ },
+
+ xit: function(desc, func) {
+ return env.xit(desc, func);
+ },
+
+ beforeEach: function(beforeEachFunction) {
+ return env.beforeEach(beforeEachFunction);
+ },
+
+ afterEach: function(afterEachFunction) {
+ return env.afterEach(afterEachFunction);
+ },
+
+ expect: function(actual) {
+ return env.expect(actual);
+ },
+
+ pending: function() {
+ return env.pending();
+ },
+
+ spyOn: function(obj, methodName) {
+ return env.spyOn(obj, methodName);
+ },
+
+ jsApiReporter: new jasmine.JsApiReporter({
+ timer: new jasmine.Timer()
+ })
+ };
+
+ /**
+ * Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
+ */
+ if (typeof window == "undefined" && typeof exports == "object") {
+ extend(exports, jasmineInterface);
+ } else {
+ extend(window, jasmineInterface);
+ }
+
+ /**
+ * Expose the interface for adding custom equality testers.
+ */
+ jasmine.addCustomEqualityTester = function(tester) {
+ env.addCustomEqualityTester(tester);
+ };
+
+ /**
+ * Expose the interface for adding custom expectation matchers
+ */
+ jasmine.addMatchers = function(matchers) {
+ return env.addMatchers(matchers);
+ };
+
+ /**
+ * Expose the mock interface for the JavaScript timeout functions
+ */
+ jasmine.clock = function() {
+ return env.clock;
+ };
+
+ /**
+ * ## Runner Parameters
+ *
+ * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
+ */
+
+ var queryString = new jasmine.QueryString({
+ getWindowLocation: function() { return window.location; }
+ });
+
+ var catchingExceptions = queryString.getParam("catch");
+ env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
+
+ /**
+ * ## Reporters
+ * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
+ */
+ var htmlReporter = new jasmine.HtmlReporter({
+ env: env,
+ onRaiseExceptionsClick: function() { queryString.setParam("catch", !env.catchingExceptions()); },
+ getContainer: function() { return document.body; },
+ createElement: function() { return document.createElement.apply(document, arguments); },
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); },
+ timer: new jasmine.Timer()
+ });
+
+ /**
+ * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
+ */
+ env.addReporter(jasmineInterface.jsApiReporter);
+ env.addReporter(htmlReporter);
+
+ /**
+ * Filter which specs will be run by matching the start of the full name against the `spec` query param.
+ */
+ var specFilter = new jasmine.HtmlSpecFilter({
+ filterString: function() { return queryString.getParam("spec"); }
+ });
+
+ env.specFilter = function(spec) {
+ return specFilter.matches(spec.getFullName());
+ };
+
+ /**
+ * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
+ */
+ window.setTimeout = window.setTimeout;
+ window.setInterval = window.setInterval;
+ window.clearTimeout = window.clearTimeout;
+ window.clearInterval = window.clearInterval;
+
+ /**
+ * ## Execution
+ *
+ * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
+ */
+ var currentWindowOnload = window.onload;
+
+ window.onload = function() {
+ if (currentWindowOnload) {
+ currentWindowOnload();
+ }
+ htmlReporter.initialize();
+ env.execute();
+ };
+
+ /**
+ * Helper function for readability above.
+ */
+ function extend(destination, source) {
+ for (var property in source) destination[property] = source[property];
+ return destination;
+ }
+
+}());
Oops, something went wrong.

0 comments on commit aa8c0d9

Please sign in to comment.