Commit 85e419af authored by JC Brand's avatar JC Brand

Add test.html for loading tests in browser and tests_main.js for calling them

Also add flush method to converse.js (used in ClientStorage tests)
parent da71c0b7
...@@ -229,6 +229,12 @@ ...@@ -229,6 +229,12 @@
chats.splice(_.indexOf(chats, jid), 1); chats.splice(_.indexOf(chats, jid), 1);
} }
store.set(key, chats); store.set(key, chats);
},
flush: function () {
// Clears all localstorage content handled by burry.js
// Only used in tests
store.flush();
} }
}); });
...@@ -370,8 +376,6 @@ ...@@ -370,8 +376,6 @@
$content = this.$el.find('.chat-content'), $content = this.$el.find('.chat-content'),
prev_date, this_date, now, separator, i; prev_date, this_date, now, separator, i;
for (i=0; i<_.size(msgs); i++) { for (i=0; i<_.size(msgs); i++) {
var msg = msgs[i], var msg = msgs[i],
msg_array = msg.split(' ', 2), msg_array = msg.split(' ', 2),
...@@ -1822,5 +1826,7 @@ ...@@ -1822,5 +1826,7 @@
} }
}, this)); }, this));
}, xmppchat)); }, xmppchat));
return xmppchat;
})); }));
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Converse.js Tests</title>
<link rel="shortcut icon" type="image/png" href="Libraries/jasmine-1.3.1/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="Libraries/jasmine-1.3.1/jasmine.css">
<script type="text/javascript" src="Libraries/jasmine-1.3.1/jasmine.js"></script>
<script type="text/javascript" src="Libraries/jasmine-1.3.1/jasmine-html.js"></script>
<!-- include source files here... -->
<script data-main="tests_main" src="Libraries/require-jquery.js"></script>
</head>
<body>
</body>
</html>
require(["jquery",
"spec/StorageSpec"], function($) {
$(function($) {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
jasmineEnv.execute();
});
});
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