Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 0809bca

Browse files
author
Anis Kadri
committed
Issue #114 testing locally
1 parent 2b745b0 commit 0809bca

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"author": "Adobe PhoneGap Team",
4141
"license": "APL",
4242
"scripts": {
43-
"test": "jasmine-node --color spec"
43+
"test": "jasmine-node --color spec",
44+
"paramedic": "./tests/scripts/start-server.sh && cordova-paramedic --platform ios && ./tests/scripts/stop-server.sh"
4445
},
4546
"devDependencies": {
4647
"jasmine-node": "1.14.5"

Diff for: tests/archives/www1.zip

736 KB
Binary file not shown.

Diff for: tests/archives/www2.zip

737 KB
Binary file not shown.

Diff for: tests/scripts/start-server.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2+
cd $DIR/../archives && python -m "SimpleHTTPServer" 4321 &

Diff for: tests/scripts/stop-server.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ps aux | grep -e "python -m SimpleHTTPServer" | grep -v grep | awk '{print "kill -1 " $2}' | sh

Diff for: tests/tests.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,36 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
1717

1818
var progressEvent = null;
1919
var url = "https://github.com/timkim/zipTest/archive/master.zip";
20+
//var url = "http://localhost:4321/www1.zip";
2021
var sync = ContentSync.sync({ src: url, id: 'myapps/myapp', type: 'replace', copyCordovaAssets: false, headers: false });
2122

2223
sync.on('progress', function(progress) {
2324
//console.log("in progress callback " + Object.getOwnPropertyNames(progress));
24-
console.log("onProgress :: " + progress.progress + " status = " + progress.status);
25+
//console.log("onProgress :: " + progress.progress + " status = " + progress.status);
2526
if(!progressEvent) {
2627
progressEvent = progress;
2728
}
2829
});
2930

3031
sync.on('complete', function(data) {
31-
console.log("progress = " + progressEvent);
32+
//console.log("progress = " + progressEvent);
3233
expect(progressEvent).toBeDefined("Progress should have been received");
3334

34-
console.log("progressEvent.status = " + progressEvent.status);
35+
//console.log("progressEvent.status = " + progressEvent.status);
3536
expect(progressEvent.status).toBeDefined("Progress event should have a status prop");
3637

3738
expect(progressEvent.progress).toBeDefined("Progress event should have a progress prop");
38-
console.log("progressEvent.progress = " + progressEvent.progress);
39+
//console.log("progressEvent.progress = " + progressEvent.progress);
3940

40-
console.log("data = " + data);
41+
//console.log("data = " + data);
4142
expect(data).toBeDefined("On complete, data is not null");
4243
done();
4344
});
4445

4546
sync.on('error', function (e) {
4647
expect(progressEvent).toBeDefined("Progress should have been received");
4748
expect(e).toBe(null, "Error callback was called :: " + e);
48-
console.log("got error back :: " + e);
49+
//console.log("got error back :: " + e);
4950
done();
5051
});
5152

0 commit comments

Comments
 (0)