Registry / testing / cascade-test

cascade-test

JSON →
library0.4.1jsnpmunverified

A test framework where context cascades through nested test hierarchy. Version 0.4.1. Built with TypeScript, ships types. Unlike Mocha or Jest, it uses plain JavaScript objects for suites, avoids global functions, and supports zero-global-pollution patterns. Integrates with c8 coverage and multiple CI systems. Suitable for Node.js >=12, actively maintained on GitHub.

npm install cascade-test
INSTALL
IMPORT
SIG · CASCADE-TEST
C
cascade-test
testingjavascriptv0.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

test
import { test } from 'cascade-test'
const test = require('cascade-test')
Default export is not available; use named import.
test (CommonJS)
const { test } = require('cascade-test')
const test = require('cascade-test')
CommonJS require must destructure the named export.
type TestObject
import type { TestObject } from 'cascade-test'
import { TestObject } from 'cascade-test'
TestObject is a TypeScript type, not a runtime value.

Shows nested suites with async setup, context cascading, and assertion library usage using TypeScript imports.

import { test } from 'cascade-test'; import assert from 'assert'; test({ setup: async () => { const data = { user: 'Alice' }; return data; }, teardown: (ctx) => { // cleanup }, 'User tests': { 'should greet': (ctx) => { assert.strictEqual(ctx.user, 'Alice'); }, 'should be async': async (ctx) => { const greeting = await Promise.resolve(`Hello, ${ctx.user}`); assert.strictEqual(greeting, 'Hello, Alice'); }, }, });
Debug
Known issues
breakingAlways return an error string or throw to fail tests; returning undefined/falsy passes. Do NOT use assertions that throw non-Error objects as they may not be caught.
fix
Ensure your assertion library throws Error instances (e.g., Node's assert module).
affects: >=0.0.1
gotchaThe `skip` option accepts a function returning an object with `reason` and optionally `until`. Forgetting the function wrapper will skip unconditionally.
fix
Use `skip: () => ({ reason: '...', until: '2025-12-31' })`.
affects: >=0.0.1
deprecatedAs of v0.4.0, the `test` function signature changed; older versions used `test(suite, options?)`. The new flat object syntax replaces callback-based suites.
fix
Upgrade to 0.4.x and use the plain object syntax.
affects: >=0.0.1 <0.4.0
gotchaContext objects are automatically merged from parent suites. Do not override properties returned by parent `setup` in child `setup` unless intentional.
fix
Use unique property names or spread to avoid overwrites.
affects: >=0.4.0
Errors
Common errors & fixes
TypeError: test is not a function
Importing default instead of named export.
fix
Use `import { test } from 'cascade-test'` or `const { test } = require('cascade-test')`.
AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
Thrown by assert but not caught; framework expects error string or thrown Error.
fix
Use assert.strictEqual or throw new Error('message') in test bodies.
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called
Default timeout (2000 ms) reached if async test does not resolve/reject quickly.
fix
Increase timeout via test object: `timeout: 5000`.
Upgrade
Version history
0.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
cascade-test — npm install cascade-test · libregistry