use "rule profiles" instead of "rules profiles"
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { RULES_PROFILES } from '../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../src/constants/profiles.js';
|
||||
import { getRulesProfile } from '../../src/utils/rule-transformer.js';
|
||||
import path from 'path';
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('MCP Configuration Validation', () => {
|
||||
|
||||
describe('MCP Configuration Path Consistency', () => {
|
||||
test('should ensure all profiles have consistent mcpConfigPath construction', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
const expectedPath = path.join(
|
||||
@@ -61,7 +61,7 @@ describe('MCP Configuration Validation', () => {
|
||||
|
||||
test('should ensure no two profiles have the same MCP config path', () => {
|
||||
const mcpPaths = new Set();
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
expect(mcpPaths.has(profile.mcpConfigPath)).toBe(false);
|
||||
@@ -71,7 +71,7 @@ describe('MCP Configuration Validation', () => {
|
||||
});
|
||||
|
||||
test('should ensure all MCP-enabled profiles use proper directory structure', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
expect(profile.mcpConfigPath).toMatch(/^\.[\w-]+\/[\w_.]+$/);
|
||||
@@ -80,7 +80,7 @@ describe('MCP Configuration Validation', () => {
|
||||
});
|
||||
|
||||
test('should ensure all profiles have required MCP properties', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
expect(profile).toHaveProperty('mcpConfig');
|
||||
expect(profile).toHaveProperty('profileDir');
|
||||
@@ -108,7 +108,7 @@ describe('MCP Configuration Validation', () => {
|
||||
describe('Profile Directory Structure', () => {
|
||||
test('should ensure each profile has a unique directory', () => {
|
||||
const profileDirs = new Set();
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
expect(profileDirs.has(profile.profileDir)).toBe(false);
|
||||
profileDirs.add(profile.profileDir);
|
||||
@@ -116,7 +116,7 @@ describe('MCP Configuration Validation', () => {
|
||||
});
|
||||
|
||||
test('should ensure profile directories follow expected naming convention', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
expect(profile.profileDir).toMatch(/^\.[\w-]+$/);
|
||||
});
|
||||
@@ -125,7 +125,7 @@ describe('MCP Configuration Validation', () => {
|
||||
|
||||
describe('MCP Configuration Creation Logic', () => {
|
||||
test('should indicate which profiles require MCP configuration creation', () => {
|
||||
const mcpEnabledProfiles = RULES_PROFILES.filter((profileName) => {
|
||||
const mcpEnabledProfiles = RULE_PROFILES.filter((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
return profile.mcpConfig !== false;
|
||||
});
|
||||
@@ -137,7 +137,7 @@ describe('MCP Configuration Validation', () => {
|
||||
});
|
||||
|
||||
test('should provide all necessary information for MCP config creation', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
expect(profile.mcpConfigPath).toBeDefined();
|
||||
@@ -152,7 +152,7 @@ describe('MCP Configuration Validation', () => {
|
||||
test('should verify that rule transformer functions use mcpConfigPath correctly', () => {
|
||||
// This test verifies that the mcpConfigPath property exists and is properly formatted
|
||||
// for use with the setupMCPConfiguration function
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
// Verify the path is properly formatted for path.join usage
|
||||
@@ -167,7 +167,7 @@ describe('MCP Configuration Validation', () => {
|
||||
});
|
||||
|
||||
test('should verify that mcpConfigPath is properly constructed for path.join usage', () => {
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
// Test that path.join works correctly with the mcpConfigPath
|
||||
@@ -186,7 +186,7 @@ describe('MCP Configuration Validation', () => {
|
||||
describe('MCP Configuration Function Integration', () => {
|
||||
test('should verify that setupMCPConfiguration receives the correct mcpConfigPath parameter', () => {
|
||||
// This test verifies the integration between rule transformer and mcp-utils
|
||||
RULES_PROFILES.forEach((profileName) => {
|
||||
RULE_PROFILES.forEach((profileName) => {
|
||||
const profile = getRulesProfile(profileName);
|
||||
if (profile.mcpConfig !== false) {
|
||||
// Verify that the mcpConfigPath can be used directly with setupMCPConfiguration
|
||||
|
||||
@@ -2,25 +2,25 @@ import {
|
||||
isValidProfile,
|
||||
getRulesProfile
|
||||
} from '../../src/utils/rule-transformer.js';
|
||||
import { RULES_PROFILES } from '../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../src/constants/profiles.js';
|
||||
|
||||
describe('Rule Transformer - General', () => {
|
||||
describe('Profile Configuration Validation', () => {
|
||||
it('should use RULES_PROFILES as the single source of truth', () => {
|
||||
// Ensure RULES_PROFILES is properly defined and contains expected profiles
|
||||
expect(Array.isArray(RULES_PROFILES)).toBe(true);
|
||||
expect(RULES_PROFILES.length).toBeGreaterThan(0);
|
||||
it('should use RULE_PROFILES as the single source of truth', () => {
|
||||
// Ensure RULE_PROFILES is properly defined and contains expected profiles
|
||||
expect(Array.isArray(RULE_PROFILES)).toBe(true);
|
||||
expect(RULE_PROFILES.length).toBeGreaterThan(0);
|
||||
|
||||
// Verify expected profiles are present
|
||||
const expectedProfiles = ['cline', 'cursor', 'roo', 'windsurf'];
|
||||
expectedProfiles.forEach((profile) => {
|
||||
expect(RULES_PROFILES).toContain(profile);
|
||||
expect(RULE_PROFILES).toContain(profile);
|
||||
});
|
||||
});
|
||||
|
||||
it('should validate profiles correctly with isValidProfile', () => {
|
||||
// Test valid profiles
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
expect(isValidProfile(profile)).toBe(true);
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('Rule Transformer - General', () => {
|
||||
|
||||
it('should return correct rules profile with getRulesProfile', () => {
|
||||
// Test valid profiles
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
expect(profileConfig).toBeDefined();
|
||||
expect(profileConfig.profileName.toLowerCase()).toBe(profile);
|
||||
@@ -46,7 +46,7 @@ describe('Rule Transformer - General', () => {
|
||||
|
||||
describe('Profile Structure', () => {
|
||||
it('should have all required properties for each profile', () => {
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
|
||||
// Check required properties
|
||||
@@ -89,7 +89,7 @@ describe('Rule Transformer - General', () => {
|
||||
'taskmaster.mdc'
|
||||
];
|
||||
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
|
||||
// Check that fileMap exists and is an object
|
||||
@@ -116,7 +116,7 @@ describe('Rule Transformer - General', () => {
|
||||
|
||||
describe('MCP Configuration Properties', () => {
|
||||
it('should have all required MCP properties for each profile', () => {
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
|
||||
// Check MCP-related properties exist
|
||||
@@ -160,7 +160,7 @@ describe('Rule Transformer - General', () => {
|
||||
}
|
||||
};
|
||||
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
const expected = expectedConfigs[profile];
|
||||
|
||||
@@ -171,7 +171,7 @@ describe('Rule Transformer - General', () => {
|
||||
});
|
||||
|
||||
it('should have consistent profileDir and mcpConfigPath relationship', () => {
|
||||
RULES_PROFILES.forEach((profile) => {
|
||||
RULE_PROFILES.forEach((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
|
||||
// The mcpConfigPath should start with the profileDir
|
||||
@@ -191,7 +191,7 @@ describe('Rule Transformer - General', () => {
|
||||
});
|
||||
|
||||
it('should have unique profile directories', () => {
|
||||
const profileDirs = RULES_PROFILES.map((profile) => {
|
||||
const profileDirs = RULE_PROFILES.map((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
return profileConfig.profileDir;
|
||||
});
|
||||
@@ -201,7 +201,7 @@ describe('Rule Transformer - General', () => {
|
||||
});
|
||||
|
||||
it('should have unique MCP config paths', () => {
|
||||
const mcpConfigPaths = RULES_PROFILES.map((profile) => {
|
||||
const mcpConfigPaths = RULE_PROFILES.map((profile) => {
|
||||
const profileConfig = getRulesProfile(profile);
|
||||
return profileConfig.mcpConfigPath;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user