Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
RobAndrewHurst committed Nov 13, 2024
1 parent 70abc51 commit f67c7ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codi-test-framework",
"version": "v0.0.45",
"version": "v0.0.46",
"description": "A simple test framework for JavaScript",
"main": "src/testRunner.js",
"type": "module",
Expand Down
32 changes: 2 additions & 30 deletions src/runners/webRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export async function runWebTestFile(testFile, options) {
export async function runWebTests(testFiles, options) {

const defaults = {
parallel: false,
quiet: false,
batchSize: 5,
showSummary: true
}

Expand All @@ -57,34 +55,8 @@ export async function runWebTests(testFiles, options) {
}

try {
if (parallel) {
if (batchSize > 0) {
// Run tests in batches
const batches = [];
for (let i = 0; i < testFiles.length; i += batchSize) {
batches.push(testFiles.slice(i, i + batchSize));
}

for (const [index, batch] of batches.entries()) {
if (!quiet) {
console.log(chalk.blue(`\nBatch ${index + 1}/${batches.length}`));
}

await Promise.all(
batch.map(file => runWebTestFile(file, options))
);
}
} else {
// Run all tests in parallel
await Promise.all(
testFiles.map(file => runWebTestFile(file, options))
);
}
} else {
// Run tests sequentially
for (const file of testFiles) {
await runWebTestFile(file, options);
}
for (const file of testFiles) {
await runWebTestFile(file, options);
}
} catch (error) {
console.error(chalk.red('\nTest execution failed:'));
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const assertFalse = assertions.assertFalse;
export const assertThrows = assertions.assertThrows;
export const assertNoDuplicates = assertions.assertNoDuplicates;

export const version = 'v0.0.45';
export const version = 'v0.0.46';

/**
* CLI entry point for running tests
Expand Down

0 comments on commit f67c7ab

Please sign in to comment.