mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 02:39:49 +00:00
Test that server can handle a relative as well as an absolute url
This commit is contained in:
parent
574d612624
commit
322fed866d
@ -1,5 +1,6 @@
|
||||
expect = require('chai').expect
|
||||
nock = require('nock')
|
||||
url = require('url')
|
||||
server = require('./server')
|
||||
config = require('../config')
|
||||
token = require('../token/token')
|
||||
@ -126,6 +127,15 @@ describe 'Server:', ->
|
||||
expect(error).to.be.an.instanceof(Error)
|
||||
done()
|
||||
|
||||
it 'should accept a full url', (done) ->
|
||||
server.request {
|
||||
method: 'GET'
|
||||
url: url.resolve(config.remoteUrl, URI.ok)
|
||||
}, (error, response) ->
|
||||
expect(error).to.not.exist
|
||||
expect(response.body.status).to.equal(STATUS.ok)
|
||||
done()
|
||||
|
||||
checkRequestTypeWithoutBody = (type) ->
|
||||
return (done) ->
|
||||
lowercaseType = type.toLowerCase()
|
||||
|
Loading…
Reference in New Issue
Block a user