chore: implement requested changes
This commit is contained in:
@@ -49,22 +49,22 @@ describe('Kiro Integration', () => {
|
||||
|
||||
// Test function that simulates the createProjectStructure behavior for Kiro files
|
||||
function mockCreateKiroStructure() {
|
||||
// Create main .kiro directory
|
||||
// This function simulates the actual kiro profile creation logic
|
||||
// It explicitly calls the mocked fs methods to ensure consistency with the test environment
|
||||
|
||||
// Simulate directory creation calls - these will call the mocked mkdirSync
|
||||
fs.mkdirSync(path.join(tempDir, '.kiro'), { recursive: true });
|
||||
|
||||
// Create settings directory
|
||||
fs.mkdirSync(path.join(tempDir, '.kiro', 'settings'), { recursive: true });
|
||||
|
||||
// Create steering directory
|
||||
fs.mkdirSync(path.join(tempDir, '.kiro', 'steering'), { recursive: true });
|
||||
|
||||
// Create MCP config file (mcp.json in settings)
|
||||
// Create MCP config file at .kiro/mcp.json (not in settings subdirectory)
|
||||
// This will call the mocked writeFileSync
|
||||
fs.writeFileSync(
|
||||
path.join(tempDir, '.kiro', 'settings', 'mcp.json'),
|
||||
path.join(tempDir, '.kiro', 'mcp.json'),
|
||||
JSON.stringify({ mcpServers: {} }, null, 2)
|
||||
);
|
||||
|
||||
// Create kiro rule files in steering directory
|
||||
// All these will call the mocked writeFileSync
|
||||
fs.writeFileSync(
|
||||
path.join(tempDir, '.kiro', 'steering', 'kiro_rules.md'),
|
||||
'# Kiro Rules\n\nKiro-specific rules and instructions.'
|
||||
@@ -91,12 +91,6 @@ describe('Kiro Integration', () => {
|
||||
expect(fs.mkdirSync).toHaveBeenCalledWith(path.join(tempDir, '.kiro'), {
|
||||
recursive: true
|
||||
});
|
||||
expect(fs.mkdirSync).toHaveBeenCalledWith(
|
||||
path.join(tempDir, '.kiro', 'settings'),
|
||||
{
|
||||
recursive: true
|
||||
}
|
||||
);
|
||||
expect(fs.mkdirSync).toHaveBeenCalledWith(
|
||||
path.join(tempDir, '.kiro', 'steering'),
|
||||
{
|
||||
@@ -111,7 +105,7 @@ describe('Kiro Integration', () => {
|
||||
|
||||
// Assert
|
||||
expect(fs.writeFileSync).toHaveBeenCalledWith(
|
||||
path.join(tempDir, '.kiro', 'settings', 'mcp.json'),
|
||||
path.join(tempDir, '.kiro', 'mcp.json'),
|
||||
JSON.stringify({ mcpServers: {} }, null, 2)
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user