broccoli-test-builder is a Broccoli.js plugin designed to construct a build tree specifically for running JavaScript tests. It aggregates test-related assets, including source code, test files, and necessary testing frameworks. The package transpiles ES6 source and test code into ES5 using Babel, runs linting with JSHint via `broccoli-lint-eslint`, and bundles test files into AMD modules, concating them into `tests/built-amd-tests.js`. It also includes an AMD loader, QUnit (JavaScript and CSS), and a test-loader, expecting a user-provided `tests/index.html` that uses specific variable markers for content injection. At version 0.4.0, this package is likely tied to older Broccoli.js ecosystems and JavaScript development practices, such as ES5 targeting and AMD modules, and is no longer actively maintained for modern web development workflows.
npm install broccoli-test-builderVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `broccoli-test-builder` into a basic `Brocfile.js` setup, funneling application and test files, then merging them with the output of the test builder. It highlights the CommonJS import and the `build` method.
Consider migrating to a modern testing setup (e.g., Jest, Vitest, Cypress, Playwright) and build tools if not strictly bound to an older Ember CLI or Broccoli.js project.
Ensure your project structure adheres to the default `lib/` and `tests/` directories, or explicitly configure `options.libDirName` if your source code resides elsewhere.
Refer to the package's README for the exact `index.html` template and ensure all `@@VARIABLE_MARKERS` are present and correctly formatted in your test `index.html`.
If linting is critical, manage it externally with ESLint directly in your project configuration, rather than relying on this package's internal linting.
This package is CommonJS only. Ensure your build process or execution environment supports CommonJS `require()` statements. This package is not compatible with pure ESM projects.
Ensure your source code is placed in a `lib/` directory relative to your Brocfile, or specify the correct path using `options.libDirName` in the `build()` call.
Verify that your `broccoli-funnel` or similar input tree configurations correctly point to existing directories and files, and that the `destDir` matches what `broccoli-test-builder` expects (e.g., `lib` for source).