organize tests into profiles folder
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { RULE_PROFILES } from '../../src/constants/profiles.js';
|
import { RULE_PROFILES } from '../../../src/constants/profiles.js';
|
||||||
import { getRulesProfile } from '../../src/utils/rule-transformer.js';
|
import { getRulesProfile } from '../../../src/utils/rule-transformer.js';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
describe('MCP Configuration Validation', () => {
|
describe('MCP Configuration Validation', () => {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
getInstalledProfiles,
|
getInstalledProfiles,
|
||||||
wouldRemovalLeaveNoProfiles
|
wouldRemovalLeaveNoProfiles
|
||||||
} from '../../src/utils/profiles.js';
|
} from '../../../src/utils/profiles.js';
|
||||||
import { rulesDirect } from '../../mcp-server/src/core/direct-functions/rules.js';
|
import { rulesDirect } from '../../../mcp-server/src/core/direct-functions/rules.js';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { jest } from '@jest/globals';
|
import { jest } from '@jest/globals';
|
||||||
@@ -2,8 +2,8 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js';
|
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
|
||||||
import { clineProfile } from '../../scripts/profiles/cline.js';
|
import { clineProfile } from '../../../scripts/profiles/cline.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
@@ -11,8 +11,8 @@ const __dirname = dirname(__filename);
|
|||||||
describe('Cline Rule Transformer', () => {
|
describe('Cline Rule Transformer', () => {
|
||||||
const testDir = path.join(__dirname, 'temp-test-dir');
|
const testDir = path.join(__dirname, 'temp-test-dir');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeEach(() => {
|
||||||
// Create test directory
|
// Create test directory before each test
|
||||||
if (!fs.existsSync(testDir)) {
|
if (!fs.existsSync(testDir)) {
|
||||||
fs.mkdirSync(testDir, { recursive: true });
|
fs.mkdirSync(testDir, { recursive: true });
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
convertAllRulesToProfileRules,
|
convertAllRulesToProfileRules,
|
||||||
convertRuleToProfileRule,
|
convertRuleToProfileRule,
|
||||||
getRulesProfile
|
getRulesProfile
|
||||||
} from '../../src/utils/rule-transformer.js';
|
} from '../../../src/utils/rule-transformer.js';
|
||||||
import { cursorProfile } from '../../scripts/profiles/cursor.js';
|
import { cursorProfile } from '../../../scripts/profiles/cursor.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
convertAllRulesToProfileRules,
|
convertAllRulesToProfileRules,
|
||||||
convertRuleToProfileRule,
|
convertRuleToProfileRule,
|
||||||
getRulesProfile
|
getRulesProfile
|
||||||
} from '../../src/utils/rule-transformer.js';
|
} from '../../../src/utils/rule-transformer.js';
|
||||||
import { rooProfile } from '../../scripts/profiles/roo.js';
|
import { rooProfile } from '../../../scripts/profiles/roo.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
@@ -2,8 +2,8 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js';
|
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
|
||||||
import { traeProfile } from '../../scripts/profiles/trae.js';
|
import { traeProfile } from '../../../scripts/profiles/trae.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
@@ -11,8 +11,8 @@ const __dirname = dirname(__filename);
|
|||||||
describe('Trae Rule Transformer', () => {
|
describe('Trae Rule Transformer', () => {
|
||||||
const testDir = path.join(__dirname, 'temp-test-dir');
|
const testDir = path.join(__dirname, 'temp-test-dir');
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeEach(() => {
|
||||||
// Create test directory
|
// Create test directory before each test
|
||||||
if (!fs.existsSync(testDir)) {
|
if (!fs.existsSync(testDir)) {
|
||||||
fs.mkdirSync(testDir, { recursive: true });
|
fs.mkdirSync(testDir, { recursive: true });
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,8 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
import { convertRuleToProfileRule } from '../../src/utils/rule-transformer.js';
|
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
|
||||||
import { windsurfProfile } from '../../scripts/profiles/windsurf.js';
|
import { windsurfProfile } from '../../../scripts/profiles/windsurf.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
isValidProfile,
|
isValidProfile,
|
||||||
getRulesProfile
|
getRulesProfile
|
||||||
} from '../../src/utils/rule-transformer.js';
|
} from '../../../src/utils/rule-transformer.js';
|
||||||
import { RULE_PROFILES } from '../../src/constants/profiles.js';
|
import { RULE_PROFILES } from '../../../src/constants/profiles.js';
|
||||||
|
|
||||||
describe('Rule Transformer - General', () => {
|
describe('Rule Transformer - General', () => {
|
||||||
describe('Profile Configuration Validation', () => {
|
describe('Profile Configuration Validation', () => {
|
||||||
@@ -4,8 +4,8 @@ import { jest } from '@jest/globals';
|
|||||||
import {
|
import {
|
||||||
removeProfileRules,
|
removeProfileRules,
|
||||||
getRulesProfile
|
getRulesProfile
|
||||||
} from '../../src/utils/rule-transformer.js';
|
} from '../../../src/utils/rule-transformer.js';
|
||||||
import { removeTaskMasterMCPConfiguration } from '../../src/utils/mcp-config-setup.js';
|
import { removeTaskMasterMCPConfiguration } from '../../../src/utils/mcp-config-setup.js';
|
||||||
|
|
||||||
// Mock logger
|
// Mock logger
|
||||||
const mockLog = {
|
const mockLog = {
|
||||||
@@ -15,7 +15,7 @@ const mockLog = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Mock the logger import
|
// Mock the logger import
|
||||||
jest.mock('../../scripts/modules/utils.js', () => ({
|
jest.mock('../../../scripts/modules/utils.js', () => ({
|
||||||
log: (level, message) => mockLog[level]?.(message)
|
log: (level, message) => mockLog[level]?.(message)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Reference in New Issue
Block a user