codi-test-framework
Advanced tools
Comparing version 0.0.33 to 0.0.34
{ | ||
"name": "codi-test-framework", | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"description": "A simple test framework for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "src/testRunner.js", |
@@ -17,3 +17,3 @@ import fs from 'fs'; | ||
let testResults = []; | ||
let version = 'v0.0.33'; | ||
let version = 'v0.0.34'; | ||
@@ -141,2 +141,22 @@ export async function describe(description, callback) { | ||
export async function runTestFunction(testFn) { | ||
try { | ||
await testFn(); | ||
} catch (error) { | ||
console.error(`Error in test ${testFn.name}:`, error); | ||
} | ||
console.log(chalk.bold.cyan('\nTest Summary:')); | ||
console.log(chalk.green(` Passed: ${passedTests}`)); | ||
console.log(chalk.red(` Failed: ${failedTests}`)); | ||
return { | ||
passedTests, | ||
failedTests, | ||
testResults | ||
} | ||
} | ||
// CLI function | ||
@@ -143,0 +163,0 @@ export async function runCLI() { |
Sorry, the diff of this file is not supported yet
18947
302