Commit fc9fdea9 authored by Arthur Verschaeve's avatar Arthur Verschaeve

Vanillajs: update to latest jasmine

parent ac8ac59e
......@@ -5,6 +5,6 @@
"todomvc-app-css": "^1.0.1"
},
"devDependencies": {
"jasmine-core": "^0.3.0"
"jasmine-core": "^2.0.0"
}
}
......@@ -6,12 +6,12 @@ describe('controller', function () {
var subject, model, view;
var setUpModel = function (todos) {
model.read.andCallFake(function (query, callback) {
model.read.and.callFake(function (query, callback) {
callback = callback || query;
callback(todos);
});
model.getCount.andCallFake(function (callback) {
model.getCount.and.callFake(function (callback) {
var todoCounts = {
active: todos.filter(function (todo) {
......@@ -26,15 +26,15 @@ describe('controller', function () {
callback(todoCounts);
});
model.remove.andCallFake(function (id, callback) {
model.remove.and.callFake(function (id, callback) {
callback();
});
model.create.andCallFake(function (title, callback) {
model.create.and.callFake(function (title, callback) {
callback();
});
model.update.andCallFake(function (id, updateData, callback) {
model.update.and.callFake(function (id, updateData, callback) {
callback();
});
};
......@@ -216,9 +216,9 @@ describe('controller', function () {
subject.setView('');
view.render.reset();
model.read.reset();
model.read.andCallFake(function (callback) {
view.render.calls.reset();
model.read.calls.reset();
model.read.and.callFake(function (callback) {
callback([{
title: 'a new todo',
completed: false
......
......@@ -3,14 +3,14 @@
<head>
<title>Jasmine Spec Runner</title>
<link rel="stylesheet" href="../node_modules/jasmine/lib/jasmine-core/jasmine.css">
<script src="../node_modules/jasmine/lib/jasmine-core/jasmine.js"></script>
<script src="../node_modules/jasmine/lib/jasmine-core/jasmine-html.js"></script>
<link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
<!-- include spec files here... -->
<script src="ControllerSpec.js"></script>
<!-- include source files here... -->
<script>
// Bootstrap app data
window.app = {};
......@@ -19,28 +19,6 @@
<script src="../js/helpers.js"></script>
<script src="../js/view.js"></script>
<script src="../js/controller.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
jasmineEnv.execute();
};
})();
</script>
</head>
<body>
</body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment