mirror of
https://github.com/wahyd4/BarcodeScanner.git
synced 2026-08-09 04:55:57 +10:00
[spec] fixing spec app
This commit is contained in:
+33
-12
@@ -22,9 +22,8 @@
|
||||
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Cordova: Camera API Specs</title>
|
||||
<title>Cordova: API Specs</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=1.0;" />
|
||||
|
||||
@@ -37,6 +36,7 @@
|
||||
<script type="text/javascript" src="html/SpecView.js"></script>
|
||||
<script type="text/javascript" src="html/SuiteView.js"></script>
|
||||
<script type="text/javascript" src="html/TrivialReporter.js"></script>
|
||||
<script type="text/javascript" src="jasmine-jsreporter.js"></script>
|
||||
|
||||
<!-- Source -->
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
@@ -49,20 +49,41 @@
|
||||
<script type="text/javascript" src="barcodescanner.tests.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('deviceready', function () {
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
jasmineEnv.updateInterval = 1000;
|
||||
var root, temp_root, persistent_root;
|
||||
|
||||
var htmlReporter = new jasmine.HtmlReporter();
|
||||
document.addEventListener('deviceready', function () {
|
||||
// one-time retrieval of the root file system entry
|
||||
var onError = function(e) {
|
||||
console.log('[ERROR] Problem setting up root filesystem for test running! Error to follow.');
|
||||
console.log(JSON.stringify(e));
|
||||
};
|
||||
|
||||
jasmineEnv.addReporter(htmlReporter);
|
||||
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
|
||||
function(fileSystem) {
|
||||
console.log('File API test Init: Setting PERSISTENT FS.');
|
||||
root = fileSystem.root; // set in file.tests.js
|
||||
persistent_root = root;
|
||||
|
||||
jasmineEnv.specFilter = function(spec) {
|
||||
return htmlReporter.specFilter(spec);
|
||||
};
|
||||
// Once root is set up, fire off tests
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
jasmineEnv.updateInterval = 1000;
|
||||
|
||||
jasmineEnv.execute();
|
||||
}, false);
|
||||
var htmlReporter = new jasmine.HtmlReporter(); var jr = new jasmine.JSReporter("http://ec2-184-72-173-33.compute-1.amazonaws.com:5984");
|
||||
|
||||
jasmineEnv.addReporter(htmlReporter);jasmineEnv.addReporter(jr);
|
||||
|
||||
jasmineEnv.specFilter = function(spec) {
|
||||
return htmlReporter.specFilter(spec);
|
||||
};
|
||||
|
||||
jasmineEnv.execute();
|
||||
}, onError);
|
||||
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0,
|
||||
function(fileSystem) {
|
||||
console.log('File API test Init: Setting TEMPORARY FS.');
|
||||
temp_root = fileSystem.root; // set in file.tests.js
|
||||
}, onError);
|
||||
}, false);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user