Use broccoli to build tests

This commit is contained in:
Joe Fiorini
2015-02-05 11:59:03 -05:00
parent a9e0de98d7
commit 13998e2898
8 changed files with 143 additions and 51 deletions

View File

@@ -20,6 +20,7 @@ var args = parseArgs(allArgs['--']);
var shouldCompress = isUndefined(args.compress) ? false : args.compress;
var debugMode = isUndefined(args.debug) ? false : args.debug;
var silentMode = isUndefined(args.silent) ? false : args.silent;
var includeTests = isUndefined(args.tests) ? true : args.tests;
var appName = 'tower';
@@ -67,6 +68,11 @@ var vendorFiles =
'ansible/*.js'
];
var testFiles =
[ 'tests/helpers.js',
'tests/unit/**/*.js'
];
function log() {
var msgs = Array.prototype.slice.apply(arguments);
@@ -133,6 +139,18 @@ var styles = compileLess(appStyles, 'less/ansible-ui.less', 'tower.min.css');
app = mergeTrees([app, styles]);
if (includeTests) {
var tests = new Funnel('awx/ui',
{ include: ['tests/unit/**/*.js']
});
tests = doDebug('tests-funnel', tests);
tests = new ES6(tests);
app = mergeTrees([app, tests]);
app = doDebug('merge-tests', app);
}
if (shouldCompress) {
app = uglifyFiles(app);
app = gzip(app,