diff --git a/tests/unit/claude-integration.test.js b/tests/unit/profiles/claude-integration.test.js similarity index 100% rename from tests/unit/claude-integration.test.js rename to tests/unit/profiles/claude-integration.test.js diff --git a/tests/unit/codex-integration.test.js b/tests/unit/profiles/codex-integration.test.js similarity index 100% rename from tests/unit/codex-integration.test.js rename to tests/unit/profiles/codex-integration.test.js diff --git a/tests/unit/cursor-integration.test.js b/tests/unit/profiles/cursor-integration.test.js similarity index 100% rename from tests/unit/cursor-integration.test.js rename to tests/unit/profiles/cursor-integration.test.js diff --git a/tests/unit/mcp-config-validation.test.js b/tests/unit/profiles/mcp-config-validation.test.js similarity index 98% rename from tests/unit/mcp-config-validation.test.js rename to tests/unit/profiles/mcp-config-validation.test.js index a6e47f45..6fb12b57 100644 --- a/tests/unit/mcp-config-validation.test.js +++ b/tests/unit/profiles/mcp-config-validation.test.js @@ -1,5 +1,5 @@ -import { RULE_PROFILES } from '../../src/constants/profiles.js'; -import { getRulesProfile } from '../../src/utils/rule-transformer.js'; +import { RULE_PROFILES } from '../../../src/constants/profiles.js'; +import { getRulesProfile } from '../../../src/utils/rule-transformer.js'; import path from 'path'; describe('MCP Configuration Validation', () => { diff --git a/tests/unit/rules-safety-check.test.js b/tests/unit/profiles/profile-safety-check.test.js similarity index 97% rename from tests/unit/rules-safety-check.test.js rename to tests/unit/profiles/profile-safety-check.test.js index 243516f1..b5846619 100644 --- a/tests/unit/rules-safety-check.test.js +++ b/tests/unit/profiles/profile-safety-check.test.js @@ -1,8 +1,8 @@ import { getInstalledProfiles, wouldRemovalLeaveNoProfiles -} from '../../src/utils/profiles.js'; -import { rulesDirect } from '../../mcp-server/src/core/direct-functions/rules.js'; +} from '../../../src/utils/profiles.js'; +import { rulesDirect } from '../../../mcp-server/src/core/direct-functions/rules.js'; import fs from 'fs'; import path from 'path'; import { jest } from '@jest/globals'; diff --git a/tests/unit/roo-integration.test.js b/tests/unit/profiles/roo-integration.test.js similarity index 100% rename from tests/unit/roo-integration.test.js rename to tests/unit/profiles/roo-integration.test.js diff --git a/tests/unit/rule-transformer-cline.test.js b/tests/unit/profiles/rule-transformer-cline.test.js similarity index 94% rename from tests/unit/rule-transformer-cline.test.js rename to tests/unit/profiles/rule-transformer-cline.test.js index a4f85c69..c96e5a87 100644 --- a/tests/unit/rule-transformer-cline.test.js +++ b/tests/unit/profiles/rule-transformer-cline.test.js @@ -2,8 +2,8 @@ import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js'; -import { clineProfile } from '../../scripts/profiles/cline.js'; +import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; +import { clineProfile } from '../../../scripts/profiles/cline.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -11,8 +11,8 @@ const __dirname = dirname(__filename); describe('Cline Rule Transformer', () => { const testDir = path.join(__dirname, 'temp-test-dir'); - beforeAll(() => { - // Create test directory + beforeEach(() => { + // Create test directory before each test if (!fs.existsSync(testDir)) { fs.mkdirSync(testDir, { recursive: true }); } diff --git a/tests/unit/rule-transformer-cursor.test.js b/tests/unit/profiles/rule-transformer-cursor.test.js similarity index 97% rename from tests/unit/rule-transformer-cursor.test.js rename to tests/unit/profiles/rule-transformer-cursor.test.js index a36272d3..580eb670 100644 --- a/tests/unit/rule-transformer-cursor.test.js +++ b/tests/unit/profiles/rule-transformer-cursor.test.js @@ -6,8 +6,8 @@ import { convertAllRulesToProfileRules, convertRuleToProfileRule, getRulesProfile -} from '../../src/utils/rule-transformer.js'; -import { cursorProfile } from '../../scripts/profiles/cursor.js'; +} from '../../../src/utils/rule-transformer.js'; +import { cursorProfile } from '../../../scripts/profiles/cursor.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/tests/unit/rule-transformer-roo.test.js b/tests/unit/profiles/rule-transformer-roo.test.js similarity index 97% rename from tests/unit/rule-transformer-roo.test.js rename to tests/unit/profiles/rule-transformer-roo.test.js index 9b538361..978c7115 100644 --- a/tests/unit/rule-transformer-roo.test.js +++ b/tests/unit/profiles/rule-transformer-roo.test.js @@ -6,8 +6,8 @@ import { convertAllRulesToProfileRules, convertRuleToProfileRule, getRulesProfile -} from '../../src/utils/rule-transformer.js'; -import { rooProfile } from '../../scripts/profiles/roo.js'; +} from '../../../src/utils/rule-transformer.js'; +import { rooProfile } from '../../../scripts/profiles/roo.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/tests/unit/rule-transformer-trae.test.js b/tests/unit/profiles/rule-transformer-trae.test.js similarity index 94% rename from tests/unit/rule-transformer-trae.test.js rename to tests/unit/profiles/rule-transformer-trae.test.js index 558dabaa..f150a2b1 100644 --- a/tests/unit/rule-transformer-trae.test.js +++ b/tests/unit/profiles/rule-transformer-trae.test.js @@ -2,8 +2,8 @@ import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js'; -import { traeProfile } from '../../scripts/profiles/trae.js'; +import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; +import { traeProfile } from '../../../scripts/profiles/trae.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -11,8 +11,8 @@ const __dirname = dirname(__filename); describe('Trae Rule Transformer', () => { const testDir = path.join(__dirname, 'temp-test-dir'); - beforeAll(() => { - // Create test directory + beforeEach(() => { + // Create test directory before each test if (!fs.existsSync(testDir)) { fs.mkdirSync(testDir, { recursive: true }); } diff --git a/tests/unit/rule-transformer-windsurf.test.js b/tests/unit/profiles/rule-transformer-windsurf.test.js similarity index 95% rename from tests/unit/rule-transformer-windsurf.test.js rename to tests/unit/profiles/rule-transformer-windsurf.test.js index 58243fd1..18aa957d 100644 --- a/tests/unit/rule-transformer-windsurf.test.js +++ b/tests/unit/profiles/rule-transformer-windsurf.test.js @@ -2,8 +2,8 @@ import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js'; -import { windsurfProfile } from '../../scripts/profiles/windsurf.js'; +import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; +import { windsurfProfile } from '../../../scripts/profiles/windsurf.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/tests/unit/rule-transformer.test.js b/tests/unit/profiles/rule-transformer.test.js similarity index 98% rename from tests/unit/rule-transformer.test.js rename to tests/unit/profiles/rule-transformer.test.js index 68cf3112..8ebd29fb 100644 --- a/tests/unit/rule-transformer.test.js +++ b/tests/unit/profiles/rule-transformer.test.js @@ -1,8 +1,8 @@ import { isValidProfile, getRulesProfile -} from '../../src/utils/rule-transformer.js'; -import { RULE_PROFILES } from '../../src/constants/profiles.js'; +} from '../../../src/utils/rule-transformer.js'; +import { RULE_PROFILES } from '../../../src/constants/profiles.js'; describe('Rule Transformer - General', () => { describe('Profile Configuration Validation', () => { diff --git a/tests/unit/selective-rules-removal.test.js b/tests/unit/profiles/selective-profile-removal.test.js similarity index 98% rename from tests/unit/selective-rules-removal.test.js rename to tests/unit/profiles/selective-profile-removal.test.js index 5f8dded1..f60c1b73 100644 --- a/tests/unit/selective-rules-removal.test.js +++ b/tests/unit/profiles/selective-profile-removal.test.js @@ -4,8 +4,8 @@ import { jest } from '@jest/globals'; import { removeProfileRules, getRulesProfile -} from '../../src/utils/rule-transformer.js'; -import { removeTaskMasterMCPConfiguration } from '../../src/utils/mcp-config-setup.js'; +} from '../../../src/utils/rule-transformer.js'; +import { removeTaskMasterMCPConfiguration } from '../../../src/utils/mcp-config-setup.js'; // Mock logger const mockLog = { @@ -15,7 +15,7 @@ const mockLog = { }; // Mock the logger import -jest.mock('../../scripts/modules/utils.js', () => ({ +jest.mock('../../../scripts/modules/utils.js', () => ({ log: (level, message) => mockLog[level]?.(message) })); diff --git a/tests/unit/windsurf-integration.test.js b/tests/unit/profiles/windsurf-integration.test.js similarity index 100% rename from tests/unit/windsurf-integration.test.js rename to tests/unit/profiles/windsurf-integration.test.js