build a conventional test tree

Usage no npm install needed!

<script type="module">
  import broccoliTestBuilder from '';



A broccoli plugin to build a tree that includes everything necessary to run tests.

Uses broccoli-lint-eslint to run jshint over the src code and test code.

Builds test files into amd modules and concats them into tests/built-amd-tests.js

Transpiles test files from es6 into es5.

Includes an amd loader, qunit.js, qunit.css, and a test-loader. Bring your own tests/index.html.


  • source code is in lib/ (if not, specify a different path with options.libDirName)
  • source code is in es6 format, suitable for transpiling with babel
  • test code is in tests/
  • an index.html exists in tests/


var testBuilder = require('broccoli-test-builder');

var options = {
  libDirName: 'path-to-your-lib-dir', // default: 'lib'
var testTree =;

 testTree looks like:
├── built-amd-tests.js
├── index.html
├── loader.js
│   └── loader.js
├── qunit
│   ├── qunit.css
│   └── qunit.js
└── test-loader
    └── test-loader.js

This is intended to be used with a test index.html that looks like the following. The capitalized variable markers will be replaced with the correct output.

<!DOCTYPE html>
  <meta charset="utf-8">
  <title>YOUR TEST TITLE</title>




  <script src="/testem.js"></script>

  <script src="../amd/YOUR-BUILT-AMD-CODE.js"></script>