mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove unused dependencies (#9833)
* Remove the adal dependency * Delete unused files * Remove request as well
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as should from 'should';
|
||||
import * as os from 'os';
|
||||
import * as adal from 'adal-node';
|
||||
import * as path from 'path';
|
||||
import 'mocha';
|
||||
|
||||
import CredentialServiceTokenCache from '../../account-provider/tokenCache';
|
||||
import { CredentialsTestProvider } from '../stubs/credentialsTestProvider';
|
||||
|
||||
describe('AccountProvider.TokenCache', function (): void {
|
||||
it('Can save and load tokens', async function (): Promise<void> {
|
||||
const tokenResponse: adal.TokenResponse = {
|
||||
tokenType: 'testTokenType',
|
||||
expiresIn: 0,
|
||||
expiresOn: new Date(),
|
||||
resource: 'testResource',
|
||||
accessToken: 'testAccessToken'
|
||||
};
|
||||
|
||||
const tokenCacheKey = 'azureTokenCache-testkey';
|
||||
const tokenCachePath = path.join(os.tmpdir(), tokenCacheKey);
|
||||
const credentialProvider = new CredentialsTestProvider();
|
||||
credentialProvider.saveCredential(tokenCacheKey, undefined);
|
||||
const tokenCache = new CredentialServiceTokenCache(credentialProvider, tokenCacheKey, tokenCachePath);
|
||||
const addResult = await tokenCache.addThenable([tokenResponse]);
|
||||
should(addResult).true('TokenResponse not added correctly');
|
||||
|
||||
const results = await tokenCache.findThenable({ tokenType: 'testTokenType' });
|
||||
should(results).deepEqual([tokenResponse]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user