Skip to content

Instantly share code, notes, and snippets.

@johanlunds
Last active December 19, 2015 06:29
Show Gist options
  • Save johanlunds/5911808 to your computer and use it in GitHub Desktop.
Save johanlunds/5911808 to your computer and use it in GitHub Desktop.
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/jasmine.css">
<script type="text/javascript" src="/jasmine.js"></script>
<script type="text/javascript" src="/jasmine-html.js"></script>
<script type="text/javascript">
(function() {
var currentWindowOnload, execJasmine, htmlReporter, jasmineEnv;
execJasmine = function() {
return jasmineEnv.execute();
};
jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
window.jsApiReporter = new jasmine.JsApiReporter();
htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.addReporter(jsApiReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
//jasmine.getFixtures().fixturesPath = 'jasmine/fixtures';
jasmine.rice = {};
jasmine.rice.autoExecute = true;
currentWindowOnload = window.onload;
return window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
if (jasmine.rice.autoExecute) {
return execJasmine();
}
};
})();
describe("offline storage", function() {
it("localstorage exists", function() {
console.log(window.localStorage);
expect(window.localStorage).toBeDefined();
});
it("indexedDb exists", function() {
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.oIndexedDB || window.msIndexedDB;
console.log(indexedDB);
expect(indexedDB).toBeDefined();
});
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment