Registry / testing / base-test-suite

base-test-suite

JSON →
library0.4.3jsnpmunverified

Test suite for base projects, providing shared unit tests for base, templates, and related frameworks (assemble, generate, verb). Version 0.4.3 is the latest stable release. It groups test filepaths by application category, allowing reuse across the ecosystem. Differentiators: avoids duplication of tests across projects that share a plugin system and conventions, with 1875+ tests covering common scenarios. Ideal for authors of base plugins or applications.

npm install base-test-suite
INSTALL
IMPORT
SIG · BASE-TEST-SUITE
B
base-test-suite
testingjavascriptv0.4.3
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.

suite
const suite = require('base-test-suite');
import suite from 'base-test-suite';
This package is CommonJS only and does not support ES modules.
suite.test.templates
const suite = require('base-test-suite'); suite.test.templates
suite.templates
Access test paths via the 'test' property; direct access misses the nesting.
require(file.path)(Constructor)
require(file.path)(Templates);
constructor = require(file.path); constructor(Templates);
Each test file exports a function that expects a constructor when called.

Shows how to set up and run the templates test suite using base-test-runner and yargs-parser.

const argv = require('yargs-parser')(process.argv.slice(2)); const runner = require('base-test-runner')(argv); const suite = require('base-test-suite'); runner.on('file', function(file) { require(file.path)(require('templates')); }); runner.addFiles(suite.test.templates); runner.run();
Debug
Known issues
gotchaThe package is intended for base ecosystem projects and may not work standalone.
fix
Ensure you have the required base packages installed and are using with base-based projects.
affects: all
gotchaTest files expect a constructor to be passed; calling them incorrectly will error.
fix
Always call the test file-path function with a constructor (e.g., require('templates')).
affects: >=0.1.0
deprecatedThe project has low activity and may be in maintenance mode; no recent releases.
fix
Consider contributing or migrating to a more modern test framework if needed.
affects: all
Errors
Common errors & fixes
TypeError: suite.test is undefined
The suite object does not have a 'test' property if the package is installed incorrectly or version is too old.
fix
Ensure you have installed base-test-suite version 0.4.3 or later and use the correct require path.
Error: Cannot find module 'base-test-runner'
The 'base-test-runner' package is not installed, but it's required to run the suite.
fix
Install base-test-runner: npm install base-test-runner --save-dev
Error: ... is not a constructor
The function exported by test file was called directly without a constructor.
fix
Call the function as require(file.path)(Constructor) where Constructor is a base application class.
Upgrade
Version history
0.4.3latest on npm
Audit
Dependencies
base-test-runnerrequiredRequired to run the test suite files as it provides runner functionality.
yargs-parseroptionalUsed to parse CLI arguments for the test runner.
templatesoptionalRequired by the example usage to pass as a constructor to test files.
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
base-test-suite — npm install base-test-suite · libregistry