| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e786cc7 commit b9b5bb3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ describe("Remote", function() { | |||
| 10 | 10 | ||
| 11 | 11 | var reposPath = local("../repos/workdir/.git"); | |
| 12 | 12 | var url = "https://github.com/nodegit/test"; | |
| 13 | + var url2 = "https://github.com/nodegit/test2"; | ||
| 13 | 14 | ||
| 14 | 15 | function removeOrigins(repository) { | |
| 15 | 16 | Remote.delete(repository, "origin1"); | |
@@ -111,28 +112,32 @@ describe("Remote", function() { | |||
| 111 | 112 | }); | |
| 112 | 113 | ||
| 113 | 114 | it("can monitor transfer progress while downloading", function() { | |
| 115 | + // Set a reasonable timeout here now that our repository has grown. | ||
| 116 | + this.timeout(15000); | ||
| 117 | + | ||
| 114 | 118 | var repo = this.repository; | |
| 115 | 119 | var wasCalled = false; | |
| 116 | 120 | ||
| 117 | - return repo.getRemote("origin") | ||
| 118 | - .then(function(remote) { | ||
| 119 | - remote.setCallbacks({ | ||
| 120 | - certificateCheck: function() { | ||
| 121 | - return 0; | ||
| 122 | - }, | ||
| 123 | - | ||
| 124 | - transferProgress: function() { | ||
| 125 | - wasCalled = true; | ||
| 126 | - } | ||
| 127 | - }); | ||
| 128 | - | ||
| 129 | - return remote.connect(NodeGit.Enums.DIRECTION.FETCH).then(function() { | ||
| 130 | - return remote.download(null); | ||
| 131 | - }); | ||
| 132 | - }) | ||
| 133 | - .then(function() { | ||
| 134 | - assert.ok(wasCalled); | ||
| 121 | + return Remote.create(repo, "test2", url2) | ||
| 122 | + .then(function() { | ||
| 123 | + return repo.getRemote("test2"); | ||
| 124 | + }) | ||
| 125 | + .then(function(remote) { | ||
| 126 | + remote.setCallbacks({ | ||
| 127 | + certificateCheck: function() { | ||
| 128 | + return 0; | ||
| 129 | + }, | ||
| 130 | + | ||
| 131 | + transferProgress: function() { | ||
| 132 | + wasCalled = true; | ||
| 133 | + } | ||
| 135 | 134 | }); | |
| 135 | + | ||
| 136 | + return remote.fetch(null, repo.defaultSignature(), null); | ||
| 137 | + }) | ||
| 138 | + .then(function() { | ||
| 139 | + assert.ok(wasCalled); | ||
| 140 | + }); | ||
| 136 | 141 | }); | |
| 137 | 142 | ||
| 138 | 143 | it("can fetch from a remote", function() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments