n8n/packages/cli/test/integration/commands/license.cmd.test.ts
कारतोफ्फेलस्क्रिप्ट™ 2d02c73fbd
refactor(core): Refactor cli command tests (no-changelog) (#9731)
2024-06-18 10:50:39 +02:00

20 lines
728 B
TypeScript

import { InternalHooks } from '@/InternalHooks';
import { License } from '@/License';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { ClearLicenseCommand } from '@/commands/license/clear';
import { setupTestCommand } from '@test-integration/utils/testCommand';
import { mockInstance } from '../../shared/mocking';
mockInstance(InternalHooks);
mockInstance(LoadNodesAndCredentials);
const license = mockInstance(License);
const command = setupTestCommand(ClearLicenseCommand);
test('license:clear invokes shutdown() to release any floating entitlements', async () => {
await command.run();
expect(license.init).toHaveBeenCalledTimes(1);
expect(license.shutdown).toHaveBeenCalledTimes(1);
});