use base profile with modifications for each brand
This commit is contained in:
@@ -14,25 +14,31 @@ describe('Cursor Profile Initialization Functionality', () => {
|
||||
cursorProfileContent = fs.readFileSync(cursorJsPath, 'utf8');
|
||||
});
|
||||
|
||||
test('cursor.js exports correct profileName and rulesDir', () => {
|
||||
expect(cursorProfileContent).toContain("const profileName = 'Cursor'");
|
||||
expect(cursorProfileContent).toContain("const rulesDir = '.cursor/rules'");
|
||||
test('cursor.js uses factory pattern with correct configuration', () => {
|
||||
expect(cursorProfileContent).toContain("name: 'cursor'");
|
||||
expect(cursorProfileContent).toContain("displayName: 'Cursor'");
|
||||
expect(cursorProfileContent).toContain("rulesDir: '.cursor/rules'");
|
||||
expect(cursorProfileContent).toContain("profileDir: '.cursor'");
|
||||
});
|
||||
|
||||
test('cursor.js preserves .mdc filenames in fileMap', () => {
|
||||
expect(cursorProfileContent).toContain('fileMap = {');
|
||||
// Should NOT contain any .md mapping
|
||||
expect(cursorProfileContent).not.toMatch(/\.md'/);
|
||||
test('cursor.js preserves .mdc extension in both input and output', () => {
|
||||
expect(cursorProfileContent).toContain("fileExtension: '.mdc'");
|
||||
expect(cursorProfileContent).toContain("targetExtension: '.mdc'");
|
||||
// Should preserve cursor_rules.mdc filename
|
||||
expect(cursorProfileContent).toContain(
|
||||
"'cursor_rules.mdc': 'cursor_rules.mdc'"
|
||||
);
|
||||
});
|
||||
|
||||
test('cursor.js contains tool naming logic and global replacements', () => {
|
||||
expect(cursorProfileContent).toContain('edit_file');
|
||||
expect(cursorProfileContent).toContain('search tool');
|
||||
test('cursor.js uses standard tool mappings (no tool renaming)', () => {
|
||||
expect(cursorProfileContent).toContain('COMMON_TOOL_MAPPINGS.STANDARD');
|
||||
// Should not contain custom tool mappings since cursor keeps original names
|
||||
expect(cursorProfileContent).not.toContain('edit_file');
|
||||
expect(cursorProfileContent).not.toContain('apply_diff');
|
||||
expect(cursorProfileContent).not.toContain('search_files tool');
|
||||
});
|
||||
|
||||
test('cursor.js contains correct documentation URL logic', () => {
|
||||
expect(cursorProfileContent).toContain('docs.cursor.com');
|
||||
test('cursor.js contains correct URL configuration', () => {
|
||||
expect(cursorProfileContent).toContain("url: 'cursor.so'");
|
||||
expect(cursorProfileContent).toContain("docsUrl: 'docs.cursor.com'");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,6 +29,11 @@ describe('Roo Files Inclusion in Package', () => {
|
||||
rooJsContent.includes('copyRecursiveSync(sourceDir, targetDir)')
|
||||
).toBe(true);
|
||||
|
||||
// Check for updated path handling
|
||||
expect(
|
||||
rooJsContent.includes("path.join(process.cwd(), 'assets', 'roocode')")
|
||||
).toBe(true);
|
||||
|
||||
// Check for .roomodes file copying logic (source and destination paths)
|
||||
expect(rooJsContent.includes("path.join(sourceDir, '.roomodes')")).toBe(
|
||||
true
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('Roo Profile Initialization Functionality', () => {
|
||||
|
||||
// Check for the general copy of assets/roocode which includes .roo base structure
|
||||
expect(rooProfileContent).toContain(
|
||||
"const sourceDir = path.resolve(__dirname, '../../assets/roocode');"
|
||||
"const sourceDir = path.join(process.cwd(), 'assets', 'roocode');"
|
||||
);
|
||||
expect(rooProfileContent).toContain(
|
||||
'copyRecursiveSync(sourceDir, targetDir);'
|
||||
|
||||
@@ -48,6 +48,11 @@ describe('Rules Files Inclusion in Package', () => {
|
||||
rooJsContent.includes('copyRecursiveSync(sourceDir, targetDir)')
|
||||
).toBe(true);
|
||||
|
||||
// Check for updated path handling
|
||||
expect(
|
||||
rooJsContent.includes("path.join(process.cwd(), 'assets', 'roocode')")
|
||||
).toBe(true);
|
||||
|
||||
// Check for .roomodes file copying logic (source and destination paths)
|
||||
expect(rooJsContent.includes("path.join(sourceDir, '.roomodes')")).toBe(
|
||||
true
|
||||
|
||||
@@ -14,30 +14,26 @@ describe('Windsurf Profile Initialization Functionality', () => {
|
||||
windsurfProfileContent = fs.readFileSync(windsurfJsPath, 'utf8');
|
||||
});
|
||||
|
||||
test('windsurf.js exports correct profileName and rulesDir', () => {
|
||||
expect(windsurfProfileContent).toContain("const profileName = 'Windsurf'");
|
||||
expect(windsurfProfileContent).toContain(
|
||||
"const rulesDir = '.windsurf/rules'"
|
||||
);
|
||||
test('windsurf.js uses factory pattern with correct configuration', () => {
|
||||
expect(windsurfProfileContent).toContain("name: 'windsurf'");
|
||||
expect(windsurfProfileContent).toContain("displayName: 'Windsurf'");
|
||||
expect(windsurfProfileContent).toContain("rulesDir: '.windsurf/rules'");
|
||||
expect(windsurfProfileContent).toContain("profileDir: '.windsurf'");
|
||||
});
|
||||
|
||||
test('windsurf.js contains fileMap for .mdc to .md mapping', () => {
|
||||
expect(windsurfProfileContent).toContain('fileMap = {');
|
||||
expect(windsurfProfileContent).toContain(".mdc'");
|
||||
expect(windsurfProfileContent).toContain(".md'");
|
||||
test('windsurf.js configures .mdc to .md extension mapping', () => {
|
||||
expect(windsurfProfileContent).toContain("fileExtension: '.mdc'");
|
||||
expect(windsurfProfileContent).toContain("targetExtension: '.md'");
|
||||
});
|
||||
|
||||
test('windsurf.js contains tool renaming and extension logic', () => {
|
||||
expect(windsurfProfileContent).toContain('edit_file');
|
||||
expect(windsurfProfileContent).toContain('apply_diff');
|
||||
expect(windsurfProfileContent).toContain('search tool');
|
||||
expect(windsurfProfileContent).toContain('search_files tool');
|
||||
expect(windsurfProfileContent).toContain('.mdc');
|
||||
expect(windsurfProfileContent).toContain('.md');
|
||||
test('windsurf.js uses transformed tool mappings', () => {
|
||||
expect(windsurfProfileContent).toContain('COMMON_TOOL_MAPPINGS.ROO_STYLE');
|
||||
// Should contain comment about transformed tool names
|
||||
expect(windsurfProfileContent).toContain('transformed tool names');
|
||||
});
|
||||
|
||||
test('windsurf.js contains correct documentation URL transformation', () => {
|
||||
expect(windsurfProfileContent).toContain('docs.cursor.com');
|
||||
expect(windsurfProfileContent).toContain('docs.windsurf.com');
|
||||
test('windsurf.js contains correct URL configuration', () => {
|
||||
expect(windsurfProfileContent).toContain("url: 'windsurf.com'");
|
||||
expect(windsurfProfileContent).toContain("docsUrl: 'docs.windsurf.com'");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user