From 884df0e2d353231e5fe2f206cee27d6e7d3e917e Mon Sep 17 00:00:00 2001 From: Brian Cardarella Date: Sat, 27 Sep 2014 17:57:16 -0400 Subject: [PATCH] Testem middleware Closes #7 Depends upon https://github.com/stefanpenner/ember-cli/pull/2128 --- index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index bff2757..b8fdf8c 100644 --- a/index.js +++ b/index.js @@ -49,14 +49,18 @@ module.exports = { }, serverMiddleware: function(options) { this.project.liveReloadFilterPatterns.push('tests/fixtures/proxy'); - var app = options.app; - options = options.options; - if (options.proxy) { - options.srcDir = path.join(this.project.root, 'tests/fixtures/proxy'); - app.use(middleware(options)); + if (options.options.proxy) { + this.middleware(options.app, options.options); } }, + middleware: function(app, options) { + options.srcDir = path.join(this.project.root, 'tests/fixtures/proxy'); + app.use(middleware(options)); + }, + testemMiddleware: function(app) { + this.middleware(app, {}); + }, postprocessTree: function(type, tree) { var treeTestLoader = pickFiles(tree, { files: ['test-loader.js'],