mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat: Release floating entitlements on license:clear command (no-changelog) (#9603)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3b10c0f6aa
commit
44ecab73d7
28
packages/cli/test/integration/commands/license.cmd.test.ts
Normal file
28
packages/cli/test/integration/commands/license.cmd.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { InternalHooks } from '@/InternalHooks';
|
||||
import { License } from '@/License';
|
||||
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
|
||||
import { ClearLicenseCommand } from '@/commands/license/clear';
|
||||
import { Config } from '@oclif/core';
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
const oclifConfig = new Config({ root: __dirname });
|
||||
|
||||
beforeAll(async () => {
|
||||
mockInstance(InternalHooks);
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
await oclifConfig.load();
|
||||
});
|
||||
|
||||
test('license:clear invokes shutdown() to release any floating entitlements', async () => {
|
||||
const cmd = new ClearLicenseCommand([], oclifConfig);
|
||||
await cmd.init();
|
||||
|
||||
const license = mockInstance(License);
|
||||
|
||||
await cmd.run();
|
||||
|
||||
expect(license.init).toHaveBeenCalledTimes(1);
|
||||
expect(license.shutdown).toHaveBeenCalledTimes(1);
|
||||
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
Reference in New Issue
Block a user