forked from KKBOX/OpenAPI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthtest.js
More file actions
21 lines (20 loc) · 871 Bytes
/
Copy pathauthtest.js
File metadata and controls
21 lines (20 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import should from 'should'
import TokenFetcher from '../src/auth/TokenFetcher'
import ClientCredentialsFlow from '../src/auth/ClientCredentialsFlow'
import {kkbox_sdk} from './client_secrets.json'
const CLIENT_ID = kkbox_sdk.client_id
const CLIENT_SECRET = kkbox_sdk.client_secret
describe('Auth Begin to Test', () => {
const tokenFetcher = new TokenFetcher(CLIENT_ID, CLIENT_SECRET)
describe('clientCredentialsFlow', () => {
describe('#fetchAccessToken()', () => {
it('should get access token', () => {
const clientCredentialsFlow = new ClientCredentialsFlow(tokenFetcher)
return clientCredentialsFlow.fetchAccessToken().then(response => {
const access_token = response.data.access_token
access_token.should.be.ok
})
})
})
})
})