Registry / testing / codi-test-framework

codi-test-framework

JSON →
library1.0.39jsnpmunverified

The Codi Test Framework is a minimalist JavaScript testing solution designed for simplicity and ease of use, providing core functionalities for writing unit and integration tests. Currently stable at version 1.0.39, it maintains an active release cadence, pushing minor updates and bug fixes as needed, with major versions reserved for significant API overhauls or new paradigm introductions. Its key differentiators include a low-overhead setup, a focus on direct, readable test syntax, and minimal configuration, making it suitable for projects that prioritize explicit test code over complex tooling or extensive plugin ecosystems often found in larger frameworks. It's ideal for quick verification tasks and projects where testing complexity needs to be kept to a minimum, aiming to provide a clear, concise developer experience without sacrificing essential testing features.

npm install codi-test-framework
INSTALL
IMPORT
SIG · CODI-TEST-FRAMEWOR
C
codi-test-framework
testingjavascriptv1.0.39
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

test
import { test } from 'codi-test-framework';
const { test } = require('codi-test-framework');
The framework primarily uses ES Modules. CommonJS require() is not supported since v1.0.
expect
import { expect } from 'codi-test-framework';
import expect from 'codi-test-framework';
The 'expect' assertion utility is a named export, not a default export.
describe
import { describe } from 'codi-test-framework';
import * as Codi from 'codi-test-framework'; Codi.describe(() => {});
For clarity and tree-shaking, it's recommended to import individual functions rather than the entire module namespace.

This quickstart demonstrates defining a test suite, asynchronous tests, and using basic assertions.

import { test, expect, describe } from 'codi-test-framework'; describe('Math Operations', () => { test('should add two numbers correctly', () => { const result = 1 + 2; expect(result).toBe(3); }); test('should handle asynchronous operations', async () => { const fetchData = () => Promise.resolve({ data: 'hello' }); const response = await fetchData(); expect(response.data).toBe('hello'); }); test('should multiply numbers', () => { expect(2 * 3).toBe(6); expect(5 * 0).toBe(0); }); }); // Simulate a test runner executing these tests console.log('Running tests with Codi Test Framework...'); // In a real scenario, these tests would be discovered and executed by a runner. // For this quickstart, assume the 'describe' and 'test' calls register tests internally. console.log('Tests completed. (Output depends on actual runner implementation)');
codi --version
Debug
Known issues
breakingThe `expect` API underwent a significant breaking change in version 1.0.0. Methods like `equals` were replaced with more descriptive `toBe` and `toEqual` to align with common testing patterns.
fix
Update assertion calls from `expect(a).equals(b)` to `expect(a).toBe(b)` for primitive comparisons, or `expect(a).toEqual(b)` for deep object comparisons.
affects: >=1.0.0
breakingAsynchronous tests in versions prior to 0.8.0 relied on a `done` callback. This callback mechanism was removed in favor of native `async/await` support for clearer asynchronous test handling.
fix
Refactor asynchronous tests to return a Promise or use the `async` keyword with `await` expressions. Remove any `done()` calls.
affects: >=0.8.0
gotchaWhen running tests in non-isolated environments (e.g., directly in a global script without a proper test runner), the `test`, `expect`, and `describe` functions might inadvertently pollute the global scope, leading to unexpected conflicts.
fix
Always run Codi Test Framework tests within a designated test runner environment or ensure that your test files are executed in modules where imports are scoped locally. Avoid global execution contexts for tests.
affects: >=0.1.0
deprecatedThe `beforeEach` and `afterEach` hooks for setting up and tearing down test environments were deprecated in version 1.0.20 due to inconsistent behavior with asynchronous operations.
fix
Migrate setup/teardown logic directly into individual test cases or use module-level `beforeAll`/`afterAll` hooks if synchronous and suitable. Consider helper functions for repetitive setup.
affects: >=1.0.20
Errors
Common errors & fixes
ReferenceError: test is not defined
Attempting to use `test` (or `describe`, `expect`) without importing it, or in a CommonJS module that doesn't support ESM imports.
fix
Ensure your test file is an ES Module (`.mjs` or `type: "module"` in `package.json`) and you've added `import { test } from 'codi-test-framework';`.
AssertionError: Expected 5 but got 3
A test assertion failed because the actual value did not match the expected value.
fix
Review the logic of your test case and the expected outcome. Ensure the code under test behaves as intended and that your assertion `expect(actual).toBe(expected)` has the correct `expected` value.
TypeError: expect(...).toEquals is not a function
Attempting to use a deprecated or incorrect assertion method. The `toEquals` method was removed in version 1.0.0.
fix
Update assertion method to `expect(...).toEqual(...)` for deep object comparison or `expect(...).toBe(...)` for primitive value comparison.
Upgrade
Version history
1.0.39latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
codi-test-framework — npm install codi-test-framework · libregistry