diff --git a/.claude/checkpoints/1755354528.json b/.claude/checkpoints/1755354528.json new file mode 100644 index 0000000000..ae8e75a46e --- /dev/null +++ b/.claude/checkpoints/1755354528.json @@ -0,0 +1 @@ +{"branch": "checkpoint/pre-edit-20250816-142848", "file": "/workspaces/claude-code-flow/validation-test/tests/fixtures/testData.js", "timestamp": "2025-08-16T14:28:48Z", "type": "pre-edit", "original_branch": "alpha90"} diff --git a/.claude/checkpoints/1755354530.json b/.claude/checkpoints/1755354530.json new file mode 100644 index 0000000000..14d8fa4754 --- /dev/null +++ b/.claude/checkpoints/1755354530.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250816-142850", "file": "/workspaces/claude-code-flow/validation-test/tests/fixtures/testData.js", "timestamp": "2025-08-16T14:28:50Z", "type": "post-edit", "branch": "alpha90", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 110 +++++++++++++---------------- .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/task-1755354490.json | 1 + claude-flow-wiki | 0 validation-test/tests/fixtures/testData.js | 68 ++++++++++++++++++ 6 files changed, 122 insertions(+), 65 deletions(-) "} diff --git a/validation-test/tests/helpers/testHelpers.js b/validation-test/tests/helpers/testHelpers.js new file mode 100644 index 0000000000..e4cc881232 --- /dev/null +++ b/validation-test/tests/helpers/testHelpers.js @@ -0,0 +1,51 @@ +// Test helper utilities +class TestHelpers { + static createMockValidator(options = {}) { + return { + validate: jest.fn().mockReturnValue(options.isValid || false), + errors: options.errors || [], + rules: options.rules || {} + }; + } + + static createValidationContext(data, rules) { + return { + data, + rules, + errors: [], + warnings: [] + }; + } + + static generateTestCases(validData, invalidData, testName) { + const cases = []; + + validData.forEach((data, index) => { + cases.push({ + name: `${testName} - valid case ${index + 1}`, + input: data, + expected: true + }); + }); + + invalidData.forEach((data, index) => { + cases.push({ + name: `${testName} - invalid case ${index + 1}`, + input: data, + expected: false + }); + }); + + return cases; + } + + static mockAsyncValidator(delay = 100, result = true) { + return jest.fn().mockImplementation(() => + new Promise(resolve => + setTimeout(() => resolve(result), delay) + ) + ); + } +} + +module.exports = TestHelpers; \ No newline at end of file