A broccoli plugin to build a tree that includes everything necessary to run tests.
Uses broccoli-jshint 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.
Assumes:
lib/ (if not, specify a different path with options.libDirName)tests/index.html exists in tests/Usage:
var testBuilder = require('broccoli-test-builder'); var options = { libDirName: 'path-to-your-lib-dir', // default: 'lib'};var testTree = testBuilder.build(); /* testTree looks like:/tests├── 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.
YOUR TEST TITLE @@QUNIT_CSS @@QUNIT_DOM @@QUNIT_JS @@LOADER_JS @@AMD_TEST_JS @@TEST_LOADER_JS