Registry / testing / ember-cli-internal-test-helpers

ember-cli-internal-test-helpers

JSON →
library0.9.1jsnpmunverified

This package, `ember-cli-internal-test-helpers`, provides a collection of utility functions designed exclusively for internal testing within the `ember-cli` project itself. It is not intended for use in Ember applications or addons developed by end-users. The current stable version is `0.9.1`. As an internal utility, it does not follow a public release cadence and its API may change without warning, reflecting the needs of the `ember-cli` core development. Its key differentiator is its specialized focus on testing `ember-cli`'s own architecture, such as blueprint generation and command execution, rather than providing helpers for testing Ember application components or routes.

testing
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.

This package primarily uses CommonJS `require` for its internal Node.js-based test helpers. Direct ES module `import` syntax is generally not applicable, and helpers are typically imported from specific paths within `lib/helpers`.

const { stub } = require('ember-cli-internal-test-helpers/lib/helpers/stub');

The root `index.js` exports the Ember CLI addon definition, which contains an `included` hook explicitly stating it's not for general consumption and does not add `app.import`s for browser tests. This means the addon itself doesn't expose public helpers via Ember's test infrastructure for end-user applications.

const addon = require('ember-cli-internal-test-helpers');

This quickstart demonstrates a conceptual usage of an internal helper like `stub` within a Node.js-based test environment, reflecting how `ember-cli` might test its own functionalities. It is not for general Ember application testing.

const { stub } = require('ember-cli-internal-test-helpers/lib/helpers/stub'); const assert = require('assert'); function myFunction(obj) { return obj.someMethod(); } // Example of using an internal stub helper in a conceptual Node.js test describe('Internal Ember CLI Test Logic', function() { let originalMethod; let testObject = { someMethod: () => 'original value' }; beforeEach(() => { // Stubs are typically managed within test setup/teardown originalMethod = testObject.someMethod; stub(testObject, 'someMethod', () => 'stubbed value'); }); afterEach(() => { testObject.someMethod = originalMethod; }); it('should use the stubbed method', function() { assert.strictEqual(myFunction(testObject), 'stubbed value'); }); });
Debug
Known footguns
gotchaThis package is explicitly for internal `ember-cli` development and is NOT intended for use in Ember applications or addons. Its API is unstable and subject to change without notice.
breakingVersion 0.8.0 removed `ember-cli` as a `devDependency`. This means the package now implicitly relies on `ember-cli` being present in the environment where it runs, rather than explicitly declaring it as a dependency. While internal, developers consuming it directly might see `ember-cli` missing errors.
gotchaThe helpers are Node.js-based and exported via CommonJS `module.exports`. They are not exposed to the browser testing environment through `app.import`s or global registrations, unlike typical Ember test helpers.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
4
ahrefsbot
3
script
1
Resources