Skip to content

Commit 1dc06f8

Browse files
committed
Fix tests
1 parent b12850c commit 1dc06f8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/integration.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ tape('read 100 bytes at an offset of 2000', function (t) {
4646
})
4747
})
4848

49-
tape('read from https flickr', function (t) {
49+
tape('read from https wikipedia', function (t) {
5050
t.plan(3)
51-
var popeye = rahttp('https://c1.staticflickr.com/3/2892/12196828014_eb4ffac150_o.jpg')
51+
var popeye = rahttp('https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png')
5252
var length = 10
5353
popeye.read(0, 10, function (err, buf) {
5454
t.error(err, 'url read without error')
@@ -59,9 +59,9 @@ tape('read from https flickr', function (t) {
5959
})
6060
})
6161

62-
tape('read from http flickr', function (t) {
62+
tape('read from http archive.org', function (t) {
6363
t.plan(3)
64-
var popeye = rahttp('http://c1.staticflickr.com/3/2892/12196828014_eb4ffac150_o.jpg')
64+
var popeye = rahttp('http://ia801009.us.archive.org/5/items/mbid-e77048de-139b-3fd3-977b-d86993e0e1b2/mbid-e77048de-139b-3fd3-977b-d86993e0e1b2-12826202809.jpg')
6565
var length = 10
6666
popeye.read(30, 10, function (err, buf) {
6767
t.error(err, 'url read without error')

tests/random-access-http.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ test('raHttp.open() callback returns error if server does not support range requ
9393
res.end()
9494
}
9595
startServer(withoutRangeSupportHandler, (err) => {
96-
t.error(err)
96+
t.error(err, 'server started without error')
9797
var ra = raHttp('without-range-support', { url: 'http://localhost:3000' })
9898
ra.read(0, 10, (err, res) => {
99-
t.ok(err.message.search(/Not opened/) !== -1)
99+
t.ok(err.message.search(/Accept-Ranges does not include/) !== -1, 'error contains "Accept-Ranges does not include"')
100100
stopServer(t)
101101
})
102102
})
@@ -109,10 +109,10 @@ test('raHttp.open() callback returns error if call to axios.head() fails', (t) =
109109
res.end()
110110
}
111111
startServer(notFoundHandler, (err) => {
112-
t.error(err)
112+
t.error(err, 'server started without error')
113113
var ra = raHttp('not-found', { url: 'http://localhost:3000' })
114114
ra.read(0, 10, (err, res) => {
115-
t.ok(err.message.search(/Not opened/) !== -1)
115+
t.ok(err.message.search(/Request failed with status code 404/) !== -1, 'error contains "Request failed with status code 404"')
116116
stopServer(t)
117117
})
118118
})

0 commit comments

Comments
 (0)