Skip to content

Commit 5960029

Browse files
committed
use real http request when testing file and archive
1 parent 8a3b646 commit 5960029

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/github.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,18 @@ describe('GitHub Remote', function () {
115115
describe('.file()', function () {
116116
it('should return an array', co(function* () {
117117
var files = remote.file('component/emitter', '1.1.1', 'component.json');
118-
files.length.should.be.ok;
118+
var result = yield* remote.request(files[0], true);
119+
result.res.statusCode.should.equal(200);
119120
}))
120121
})
121122

122123
describe('.archive()', function () {
123124
it('should return an object', co(function* () {
124125
var archive = remote.archive('component/emitter');
125-
archive.zip.length.should.be.ok;
126-
archive.tar.length.should.be.ok;
126+
var zipResult = yield* remote.request(archive.zip[0]);
127+
var tarResult = yield* remote.request(archive.tar[0]);
128+
zipResult.res.statusCode.should.equal(200);
129+
tarResult.res.statusCode.should.equal(200);
127130
}))
128131
})
129132
})

0 commit comments

Comments
 (0)