{"id":18028,"library":"ember-cli-internal-test-helpers","title":"Ember CLI Internal Test Helpers","description":"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.","status":"maintenance","version":"0.9.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/ember-cli/ember-cli-internal-test-helpers","tags":["javascript","['ember-cli']"],"install":[{"cmd":"npm install ember-cli-internal-test-helpers","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-internal-test-helpers","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-internal-test-helpers","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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`.","wrong":"import { stub } from 'ember-cli-internal-test-helpers/lib/helpers/stub';\n// or\nimport stub from 'ember-cli-internal-test-helpers/lib/helpers/stub';","symbol":"stub","correct":"const { stub } = require('ember-cli-internal-test-helpers/lib/helpers/stub');"},{"note":"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.","symbol":"module.exports","correct":"const addon = require('ember-cli-internal-test-helpers');"}],"quickstart":{"code":"const { stub } = require('ember-cli-internal-test-helpers/lib/helpers/stub');\nconst assert = require('assert');\n\nfunction myFunction(obj) {\n  return obj.someMethod();\n}\n\n// Example of using an internal stub helper in a conceptual Node.js test\ndescribe('Internal Ember CLI Test Logic', function() {\n  let originalMethod;\n  let testObject = {\n    someMethod: () => 'original value'\n  };\n\n  beforeEach(() => {\n    // Stubs are typically managed within test setup/teardown\n    originalMethod = testObject.someMethod;\n    stub(testObject, 'someMethod', () => 'stubbed value');\n  });\n\n  afterEach(() => {\n    testObject.someMethod = originalMethod;\n  });\n\n  it('should use the stubbed method', function() {\n    assert.strictEqual(myFunction(testObject), 'stubbed value');\n  });\n});","lang":"javascript","description":"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."},"warnings":[{"fix":"Do not install or use `ember-cli-internal-test-helpers` in your application or addon. Use `@ember/test-helpers` or other community-maintained test helper addons instead.","message":"This 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure `ember-cli` is available in your test environment's `node_modules` if you are maintaining or extending `ember-cli`'s internal tests that use this package. For end-users, this change reinforces that the package is not for general consumption.","message":"Version 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.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Do not attempt to `import` these helpers for use in browser-based Ember application tests (e.g., integration or acceptance tests). They are designed for Node.js-specific testing contexts within `ember-cli`.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Verify the exact path and name of the helper in the package's `lib/helpers` directory on GitHub. Ensure you are using CommonJS `require()` syntax for Node.js environments.","cause":"Attempting to import a helper that does not exist at the specified path or trying to use ES Modules `import` syntax.","error":"Error: Cannot find module 'ember-cli-internal-test-helpers/lib/helpers/some-unknown-helper'"},{"fix":"Ensure you are correctly destructuring the named export (e.g., `const { stub } = require(...)`) or accessing the property on the imported module (e.g., `const helpers = require(...); helpers.stub(...)`). Check the source code for the correct export structure.","cause":"The imported symbol is not a function, or the helper was not correctly destructuring from `module.exports`.","error":"TypeError: someHelper is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}