Registry / testing / lambda-tdd

lambda-tdd

JSON →
library9.0.5jsnpmunverified

Lambda-TDD is a testing framework for AWS Lambda functions, version 9.0.5 as of this entry. It enables integration tests defined as JSON files, modeling cloud execution closely by executing Lambda functions via Lambda-Wrapper, mocking external requests with Nock, setting environment variables per test, freezing time with Timekeeper, and checking success/error responses. Released on npm, it requires Node >=20 and peer dependencies Chai >=5.0.0 and Nock >=13.2.4. Differentiators include JSON-based test definitions, granular environment variable control, and built-in nock healing.

npm install lambda-tdd
INSTALL
IMPORT
SIG · LAMBDA-TDD
L
lambda-tdd
testingjavascriptv9.0.5
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.

LambdaTdd
import LambdaTdd from 'lambda-tdd'
const LambdaTdd = require('lambda-tdd')
Package is ESM-only since v9; use ES import syntax. CommonJS require will fail.
default export
import LambdaTdd from 'lambda-tdd'
import { LambdaTdd } from 'lambda-tdd'
LambdaTdd is a default export, not a named export.
type inference (TypeScript)
import LambdaTdd from 'lambda-tdd'; type Opts = Parameters<typeof LambdaTdd>[0];
const LambdaTdd: any = require('lambda-tdd');
For TypeScript usage, import the default function to access its type parameters.

Initialize LambdaTdd test runner with command-line options and execute all auto-detected test files.

import fs from 'smart-fs'; import minimist from 'minimist'; import LambdaTdd from 'lambda-tdd'; const opts = { cwd: fs.dirname(import.meta.url), verbose: minimist(process.argv.slice(2)).verbose === true, timeout: minimist(process.argv.slice(2)).timeout, nockHeal: minimist(process.argv.slice(2))['nock-heal'] }; LambdaTdd(opts).execute();
Debug
Known issues
breakingESM-only since v9: require() not supported; must use import.
fix
Replace const x = require('lambda-tdd') with import x from 'lambda-tdd'; ensure tsconfig.json has module resolution set to 'node16' or 'bundler'.
affects: >=9.0.0
gotchaPeer dependencies must be manually installed: chai >=5.0.0 and nock >=13.2.4 are not auto-installed.
fix
Run: npm install --save-dev chai@>=5.0.0 nock@>=13.2.4
affects: >=9.0.0
gotchaWhen using npm test and filter, prefix with -- to pass args through: npm t -- --filter=myTest
fix
Use: npm t -- --filter=REGEX (note the extra --)
affects: all
deprecatedOption 'nockHeal' may be deprecated in future versions; check documentation.
fix
Review changelog for migration; consider using nock's native cleanup.
affects: <10.0.0 (pre-v10)
Errors
Common errors & fixes
Cannot find module 'lambda-tdd'
Package not installed or ESM import used with CommonJS script.
fix
Run npm install --save-dev lambda-tdd; ensure package.json has 'type': 'module' or use .mjs extension.
TypeError: LambdaTdd is not a constructor
Using require() instead of import in ESM-only version.
fix
Switch to import LambdaTdd from 'lambda-tdd'. For Node <20, upgrade or use bundler.
Error: Cannot find module 'chai'
Peer dependency chai not installed.
fix
Run: npm install --save-dev chai@>=5.0.0
Upgrade
Version history
9.0.5latest on npm
Audit
Dependencies
chairequiredUsed for dynamic assertion evaluation in test definitions.
nockrequiredUsed for mocking external HTTP requests in tests.
Agent activity
2 hits · last 30 days
node
2
Resources
lambda-tdd — npm install lambda-tdd · libregistry