Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/unit.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import VaultClient from '../src/VaultClient.js';

describe('Unit tests', function () {

const TEST_TOKEN = 'test-not-a-real-token';

const bootOpts = deepFreeze({
api: { url: 'https://example.com/' },
logger: false,
auth: {
type: 'token',
config: {
token: 'XXXXXXXX-eb8e-5f25-fad2-79274fa13a64',
token: TEST_TOKEN,
}
},
});
Expand Down Expand Up @@ -42,6 +44,7 @@ describe('Unit tests', function () {
it('should clear a client and allow re-creation', () => {
const client = VaultClient.boot('primaryClient', bootOpts);
VaultClient.clear('primaryClient');
expect(() => VaultClient.get('primaryClient')).to.throw(Error, 'Invalid instance name');

const recreatedClient = VaultClient.boot('primaryClient', bootOpts);
expect(recreatedClient).to.be.instanceOf(VaultClient);
Expand Down
Loading