mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-08 03:44:13 +00:00
Fix auth utils tests to work with new SDK
This commit is contained in:
parent
e965c603d2
commit
d3a0bfc5f6
@ -78,6 +78,7 @@
|
||||
"publish-release": "^1.3.3",
|
||||
"require-npm4-to-publish": "^1.0.0",
|
||||
"resin-lint": "^1.5.0",
|
||||
"rewire": "^3.0.2",
|
||||
"ts-node": "^4.0.1",
|
||||
"typescript": "2.4.0"
|
||||
},
|
||||
|
@ -1,10 +1,13 @@
|
||||
m = require('mochainon')
|
||||
url = require('url')
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
utils = require('../../build/auth/utils')
|
||||
|
||||
tokens = require('./tokens.json')
|
||||
|
||||
rewire = require('rewire')
|
||||
utils = rewire('../../build/auth/utils')
|
||||
resin = utils.__get__('resin')
|
||||
|
||||
describe 'Utils:', ->
|
||||
|
||||
describe '.getDashboardLoginURL()', ->
|
||||
@ -90,7 +93,9 @@ describe 'Utils:', ->
|
||||
|
||||
it 'should stay without a token', ->
|
||||
utils.isTokenValid(tokens.johndoe.token).then ->
|
||||
m.chai.expect(resin.token.get()).to.eventually.not.exist
|
||||
resin.auth.isLoggedIn()
|
||||
.then (isLoggedIn) ->
|
||||
m.chai.expect(isLoggedIn).to.equal(false)
|
||||
|
||||
describe 'given the token does authenticate with the server', ->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user