{"id":13117,"library":"ember-cli-test-loader","title":"Ember CLI Test Loader","description":"ember-cli-test-loader is an essential Ember CLI addon designed to manage and load test modules within an Ember application. It reviews modules in `requirejs.entries` to identify and load test files, providing a customizable `shouldLoadModule` method for defining test module criteria. The current stable version is 3.1.0, which includes ambient types for improved TypeScript support. This package is fundamental for running tests in Ember CLI projects, working closely with the build system to ensure only relevant test files are loaded during the testing phase. Its release cadence typically aligns with Ember CLI updates, focusing on compatibility and necessary maintenance, rather than frequent new features. It differentiates itself by being the standard, integrated solution for test loading within the Ember ecosystem, avoiding the need for manual test file management.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ember-cli/ember-cli-test-loader","tags":["javascript","ember-addon"],"install":[{"cmd":"npm install ember-cli-test-loader","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-test-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-test-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Babel compilation of Ember CLI assets, explicitly updated in v3.0.0 breaking change.","package":"ember-cli-babel","optional":false},{"reason":"Peer dependency for all Ember CLI addons.","package":"ember-cli","optional":false}],"imports":[{"note":"TestLoader is a default export from its test-support module.","wrong":"import { TestLoader } from 'ember-cli-test-loader/test-support';","symbol":"TestLoader","correct":"import TestLoader from 'ember-cli-test-loader/test-support';"},{"note":"Since v3.1.0, ambient types are published, allowing type imports.","symbol":"TestLoader","correct":"import type TestLoaderType from 'ember-cli-test-loader/test-support';"},{"note":"CommonJS require style for older Node.js environments or build systems. Still imports the default export.","wrong":"const { TestLoader } = require('ember-cli-test-loader/test-support');","symbol":"TestLoader","correct":"const TestLoader = require('ember-cli-test-loader/test-support');"}],"quickstart":{"code":"import TestLoader from 'ember-cli-test-loader/test-support';\n\n// To customize which modules are loaded as tests, override shouldLoadModule.\n// For example, only load files ending with '-test.js' or '-spec.js'\nTestLoader.prototype.shouldLoadModule = function(moduleName) {\n  const isTestFile = moduleName.endsWith('-test.js') || moduleName.endsWith('-spec.js');\n  // You might also check if the module is within a specific 'tests/' directory structure\n  // if (!moduleName.startsWith('your-app/tests/')) return false;\n  return isTestFile && !moduleName.includes('/node_modules/');\n};\n\n// Load all identified test modules\nTestLoader.load();\n\nconsole.log('Test modules loaded.');\n// In a real Ember app, this would be part of your `tests/test-helper.js`","lang":"javascript","description":"Demonstrates importing TestLoader and optionally overriding its 'shouldLoadModule' method before initiating the test loading process in an Ember CLI project."},"warnings":[{"fix":"Upgrade Node.js to version 10 or greater. The package officially supports Node.js 10.* || >= 12.","message":"Version 3.0.0 dropped support for Node.js versions 6 and 8. Projects using these older Node versions will encounter errors.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Update `ember-cli-babel` in your project's `package.json` to a compatible version (e.g., `^7.1.3` or later) and reinstall dependencies.","message":"Version 3.0.0 updated the `ember-cli-babel` requirement from `^6.8.1` to `^7.1.3`. Ensure your project's `ember-cli-babel` dependency meets this new minimum to avoid build failures.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure this package is used within a standard Ember CLI project setup where the `requirejs` global is correctly initialized by the build system.","message":"This addon relies on `requirejs.entries` and the Ember CLI build pipeline. Using `ember-cli-test-loader` in a non-Ember or non-RequireJS environment will likely result in runtime errors as the global `requirejs` object or its entries will not be available.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `ember-cli-test-loader` is only used within an Ember CLI application or addon's testing setup, typically in `tests/test-helper.js`.","cause":"The package is being used outside of an Ember CLI project context where the `requirejs` global object is not available.","error":"ReferenceError: requirejs is not defined"},{"fix":"Upgrade Node.js to version 10 or higher. The `engines.node` field specifies `10.* || >= 12`.","cause":"Your Node.js environment is older than the minimum required by `ember-cli-test-loader` v3.0.0+.","error":"Error: The 'engines' field in package.json is incompatible with your current node version."},{"fix":"Add `import TestLoader from 'ember-cli-test-loader/test-support';` to the top of your test helper file.","cause":"The `TestLoader` object was not correctly imported before being used.","error":"ReferenceError: TestLoader is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}