Skip to content

Commit 0f71020

Browse files
committed
modifying mocking of requests to fix tests
1 parent ab6f535 commit 0f71020

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/params.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ describe('LDNODE params', function () {
2929
nock('https://amazingwebsite.tld')
3030
.get('/')
3131
.reply(function (uri, req) {
32+
if (this.req.headers['accept'] !== 'text/turtle') {
33+
throw Error('Accept is received on the header')
34+
}
3235
if (this.req.headers['test'] && this.req.headers['test'] === 'test1') {
33-
return [200, 'YES', {'content-type': this.req.headers['accept']}]
36+
return [200, 'YES']
3437
} else {
3538
return [500, 'empty']
3639
}
3740
})
3841

3942
server.get('/proxy?uri=https://amazingwebsite.tld/')
4043
.set('test', 'test1')
41-
.set('accept', 'application/json')
44+
.set('accept', 'text/turtle')
4245
.expect(200)
43-
.expect('content-type', 'application/json')
4446
.end(function (err, data) {
4547
if (err) return done(err)
4648
done(err)

0 commit comments

Comments
 (0)