mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Reorder server unit test to get more meaningful results
This commit is contained in:
parent
15620145eb
commit
48d39a39f8
@ -85,10 +85,10 @@ describe 'Data:', ->
|
||||
expect(value).to.equal(FILESYSTEM.nested.contents)
|
||||
done()
|
||||
|
||||
it 'should return an error if reading an invalid key', (done) ->
|
||||
it 'should return undefined if reading an invalid key', (done) ->
|
||||
data.get 'nonexistantkey', encoding: 'utf8', (error, value) ->
|
||||
expect(error).to.be.an.instanceof(Error)
|
||||
expect(value).to.not.exist
|
||||
expect(error).to.not.exist
|
||||
expect(value).to.be.undefined
|
||||
done()
|
||||
|
||||
it 'should return an error if not reading a file', (done) ->
|
||||
@ -131,8 +131,8 @@ describe 'Data:', ->
|
||||
|
||||
(callback) ->
|
||||
data.get filename, encoding: 'utf8', (error, value) ->
|
||||
expect(error).to.be.an.instanceof(Error)
|
||||
expect(value).to.not.exist
|
||||
expect(error).to.not.exist
|
||||
expect(value).to.be.undefined
|
||||
return callback()
|
||||
|
||||
(callback) ->
|
||||
@ -169,8 +169,8 @@ describe 'Data:', ->
|
||||
|
||||
(callback) ->
|
||||
data.get key, encoding: 'utf8', (error, value) ->
|
||||
expect(error).to.be.an.instanceof(Error)
|
||||
expect(value).to.not.exist
|
||||
expect(error).to.not.exist
|
||||
expect(value).to.be.undefined
|
||||
return callback()
|
||||
|
||||
], (error) ->
|
||||
|
@ -156,9 +156,8 @@ describe 'Server:', ->
|
||||
|
||||
it 'should not send the Authorization header', (done) ->
|
||||
server.request 'GET', URI.ok, null, (error, response) ->
|
||||
authorizationHeader = response.request.headers.Authorization
|
||||
|
||||
expect(error).to.not.exist
|
||||
authorizationHeader = response.request.headers.Authorization
|
||||
expect(authorizationHeader).to.not.exist
|
||||
done()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user