update tests

This commit is contained in:
Joe Danziger
2025-06-04 19:00:11 -04:00
parent 30e14eedc0
commit b46dc794d9
3 changed files with 18 additions and 18 deletions

View File

@@ -21,8 +21,8 @@ describe('Roo Files Inclusion in Package', () => {
const rooJsPath = path.join(process.cwd(), 'scripts', 'profiles', 'roo.js');
const rooJsContent = fs.readFileSync(rooJsPath, 'utf8');
// Check for the main handler function
expect(rooJsContent.includes('onAddRulesProfile(targetDir)')).toBe(true);
// Check for the main handler function
expect(rooJsContent.includes('onAddRulesProfile(targetDir, assetsDir)')).toBe(true);
// Check for general recursive copy of assets/roocode
expect(
@@ -31,7 +31,7 @@ describe('Roo Files Inclusion in Package', () => {
// Check for updated path handling
expect(
rooJsContent.includes("path.join(process.cwd(), 'assets', 'roocode')")
rooJsContent.includes("path.join(assetsDir, 'roocode')")
).toBe(true);
// Check for .roomodes file copying logic (source and destination paths)
@@ -73,7 +73,7 @@ describe('Roo Files Inclusion in Package', () => {
// We should be able to find the template literals that use the mode variable
expect(rooJsContent.includes('`rules-${mode}`')).toBe(true);
expect(rooJsContent.includes('`${mode}-rules`')).toBe(true);
expect(rooJsContent.includes("for mode '${mode}'")).toBe(true);
expect(rooJsContent.includes('Copied ${mode}-rules to ${dest}')).toBe(true);
// Also verify that the expected mode names are defined in the imported constant
// by checking that the import is from the correct file that contains all 6 modes

View File

@@ -11,14 +11,14 @@ describe('Roo Profile Initialization Functionality', () => {
rooProfileContent = fs.readFileSync(rooJsPath, 'utf8');
});
test('roo.js profile ensures Roo directory structure via onAddRulesProfile', () => {
// Check if onAddRulesProfile function exists
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir)');
test('roo.js profile ensures Roo directory structure via onAddRulesProfile', () => {
// Check if onAddRulesProfile function exists
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir, assetsDir)');
// Check for the general copy of assets/roocode which includes .roo base structure
expect(rooProfileContent).toContain(
"const sourceDir = path.join(process.cwd(), 'assets', 'roocode');"
);
// Check for the general copy of assets/roocode which includes .roo base structure
expect(rooProfileContent).toContain(
"const sourceDir = path.join(assetsDir, 'roocode');"
);
expect(rooProfileContent).toContain(
'copyRecursiveSync(sourceDir, targetDir);'
);
@@ -34,8 +34,8 @@ describe('Roo Profile Initialization Functionality', () => {
);
});
test('roo.js profile copies .roomodes file via onAddRulesProfile', () => {
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir)');
test('roo.js profile copies .roomodes file via onAddRulesProfile', () => {
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir, assetsDir)');
// Check for the specific .roomodes copy logic
expect(rooProfileContent).toContain(
@@ -49,8 +49,8 @@ describe('Roo Profile Initialization Functionality', () => {
);
});
test('roo.js profile copies mode-specific rule files via onAddRulesProfile', () => {
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir)');
test('roo.js profile copies mode-specific rule files via onAddRulesProfile', () => {
expect(rooProfileContent).toContain('onAddRulesProfile(targetDir, assetsDir)');
expect(rooProfileContent).toContain('for (const mode of ROO_MODES)');
// Check for the specific mode rule file copy logic

View File

@@ -40,8 +40,8 @@ describe('Rules Files Inclusion in Package', () => {
const rooJsPath = path.join(process.cwd(), 'scripts', 'profiles', 'roo.js');
const rooJsContent = fs.readFileSync(rooJsPath, 'utf8');
// Check for the main handler function
expect(rooJsContent.includes('onAddRulesProfile(targetDir)')).toBe(true);
// Check for the main handler function
expect(rooJsContent.includes('onAddRulesProfile(targetDir, assetsDir)')).toBe(true);
// Check for general recursive copy of assets/roocode
expect(
@@ -50,7 +50,7 @@ describe('Rules Files Inclusion in Package', () => {
// Check for updated path handling
expect(
rooJsContent.includes("path.join(process.cwd(), 'assets', 'roocode')")
rooJsContent.includes("path.join(assetsDir, 'roocode')")
).toBe(true);
// Check for .roomodes file copying logic (source and destination paths)