Skip to content
Permalink
Browse files

tests created

  • Loading branch information...
vettaioa committed May 17, 2018
0 parents commit 5e1d249141ce6c2175e6ac4a6a7731c3b367d449
@@ -0,0 +1,20 @@
Copyright (c) 2008-2017 Pivotal Labs

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>

<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.9.1/jasmine_favicon.png">
<link rel="stylesheet" href="lib/jasmine-2.9.1/jasmine.css">

<script type="text/javascript" src="lib/jquery-3.3.1.js"></script>


<script src="lib/jasmine-2.9.1/jasmine.js"></script>
<script src="lib/jasmine-2.9.1/jasmine-html.js"></script>
<script src="lib/jasmine-2.9.1/boot.js"></script>
<script type="text/javascript" src="lib/jasmine-jquery.js"></script>

<!-- include source files here... -->
<script type="text/javascript" src="src/Task.js"></script>
<script type="text/javascript" src="src/TaskList.js"></script>

<!-- include spec files here... -->
<script type="text/javascript" src="spec/TaskSpec.js"></script>
<script type="text/javascript" src="spec/TaskListSpec.js"></script>


</head>

<body>
</body>
</html>
@@ -0,0 +1,34 @@
/* ein bisschen css, wo ich mit materialize nicht weiter komme... */

body {
min-height: 100vh;
display: flex;
flex-direction: column;
background: #EC6F66;
/* fallback for old browsers */
background: -webkit-linear-gradient(to top, #F3A183, #EC6F66);
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to top, #F3A183, #EC6F66);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

main {
padding: 1rem;
flex: 1 0 auto;
}

.finished input[type="text"] {
color: grey;
}

footer {
padding: 2rem 0;
}

a.btn-small {
margin: 1rem;
}

input::placeholder {
color: darkslategrey;
}
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>

<head>
<title>TODOs</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="application.css" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">

<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script>

<!-- icon fun -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">


<script type="text/javascript" src="lib/jquery-3.3.1.js"></script>
<script type="text/javascript" src="src/templateStrings.js"></script>
<!-- <script type="text/javascript" src="src/Task.js"></script> -->
<script type="text/javascript" src="src/TaskList.js"></script>
<script type="text/javascript" src="src/Demo.js"></script>
</head>

<body class="container">
<main class="col s12">
<h1>Amazing to-do list</h1>
<div id="taskList"></div>
</main>

<footer class="col s12">
<a class="waves-effect waves-light btn-small disabled">
<i class="material-icons left">cloud_upload</i>
Save to server
</a>
<a id='createTask' class="waves-effect waves-light btn-small ">
<i class="material-icons left">add_box</i>
Create a task
</a>
<a class="waves-effect waves-light btn-small" href="SpecRunner.html" target="_blank" rel="noopener">
<i class="material-icons left">videogame_asset</i>
test tha shit out of it
</a>

</footer>



</body>

</html>
@@ -0,0 +1,133 @@
/**
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` and `jasmine_html.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 = jasmineRequire.interface(jasmine, env);

/**
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
*/
extend(window, jasmineInterface);

/**
* ## 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 filterSpecs = !!queryString.getParam("spec");

var catchingExceptions = queryString.getParam("catch");
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);

var throwingExpectationFailures = queryString.getParam("throwFailures");
env.throwOnExpectationFailure(throwingExpectationFailures);

var random = queryString.getParam("random");
env.randomizeTests(random);

var seed = queryString.getParam("seed");
if (seed) {
env.seed(seed);
}

/**
* ## 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.navigateWithNewParam("catch", !env.catchingExceptions()); },
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
onRandomClick: function() { queryString.navigateWithNewParam("random", !env.randomTests()); },
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
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(),
filterSpecs: filterSpecs
});

/**
* 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;
}

}());

0 comments on commit 5e1d249

Please sign in to comment.
You can’t perform that action at this time.