CanJS Test Helpers is a utility package designed to provide common testing functions specifically for modules within the CanJS ecosystem. Currently at version 1.1.4, its primary features include `willWarn` and `willError` for intercepting and asserting against `canDev.warn` and `canDev.error` calls, and `devOnlyTest` for defining tests that execute only in development environments. The package ensures compatibility with modern testing setups by requiring QUnit 2.x since version 1.1.4. Its release cadence is generally aligned with updates in the broader CanJS family of libraries, such as `can-log` and `can-util`, ensuring seamless integration. A key differentiator is its direct interaction with CanJS's internal development logging mechanisms, providing fine-grained control over testing expected warnings and errors, which is crucial for library maintainers and application developers building with CanJS.
npm install can-test-helpersVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `willWarn` and `willError` helpers to intercept and assert against development warnings and errors in a CanJS context.
Upgrade QUnit in your project to v2 or higher. Adjust any QUnit 1.x specific assertions if necessary.
Ensure `can-log/dev/dev` is a dependency of your project and correctly imported or globally available where CanJS is used, or provide a mock `canDev` object with `warn` and `error` methods.
Upgrade QUnit to version 2 or higher in your project's `devDependencies`. If using a test runner, ensure it's configured to use the updated QUnit.
Verify that `can-log/dev/dev` is installed (`npm install can-log --save-dev`) and correctly imported or globally available in your test setup. If not running a full CanJS app, you might need to mock `global.canDev` with `warn` and `error` methods.
No dependency data recorded yet.