feat: improve tm auto-update display (#1444)

This commit is contained in:
Ralph Khreish
2025-11-25 21:23:00 +01:00
committed by GitHub
parent 2316e94b28
commit 77b3b7780d
14 changed files with 996 additions and 422 deletions

View File

@@ -91,12 +91,16 @@ jest.mock('../../scripts/modules/utils.js', () => ({
// Import all modules after mocking
import fs from 'fs';
import path from 'path';
import { compareVersions } from '@tm/cli';
import {
displayUpgradeNotification,
parseChangelogHighlights
} from '../../apps/cli/src/utils/auto-update/index.js';
import { setupCLI } from '../../scripts/modules/commands.js';
import {
RULES_SETUP_ACTION,
RULES_ACTIONS
RULES_ACTIONS,
RULES_SETUP_ACTION
} from '../../src/constants/rules-actions.js';
import { compareVersions } from '@tm/cli';
describe('Commands Module - CLI Setup and Integration', () => {
const mockExistsSync = jest.spyOn(fs, 'existsSync');
@@ -278,17 +282,8 @@ describe('Version comparison utility', () => {
});
describe('Update check functionality', () => {
let displayUpgradeNotification;
let parseChangelogHighlights;
let consoleLogSpy;
beforeAll(async () => {
// Import from @tm/cli instead of commands.js
const cliModule = await import('../../apps/cli/src/utils/auto-update.js');
displayUpgradeNotification = cliModule.displayUpgradeNotification;
parseChangelogHighlights = cliModule.parseChangelogHighlights;
});
beforeEach(() => {
consoleLogSpy = jest.spyOn(console, 'log').mockImplementation(() => {});
});