test(e2e): add support for e2e app and running tests.

This commit is contained in:
Hans Larsen
2016-05-19 13:20:21 -07:00
parent 3513ff36e7
commit 6a84fc556c
23 changed files with 335 additions and 32 deletions
+43 -6
View File
@@ -25,7 +25,7 @@ module.exports = function(defaults) {
/**
* Build the Broccoli Tree containing all the files used as the input to the Angular2App.
* Build the Broccoli Tree containing all the files used as the input to the Demo Angular2App.
*/
function _buildDemoAppInputTree() {
return new MergeTree([
@@ -42,6 +42,26 @@ function _buildDemoAppInputTree() {
]);
}
/**
* Build the Broccoli Tree containing all the files used as the input to the e2e Angular2App.
*/
function _buildE2EAppInputTree() {
return new MergeTree([
new Funnel('typings', {
destDir: 'typings'
}),
new Funnel('src', {
include: ['components/**/*', 'core/**/*'],
destDir: 'src/e2e-app'
}),
new Funnel('src/e2e-app', {
destDir: 'src/e2e-app'
})
]);
}
/**
* Build the Broccoli Tree that contains the Angular2 App. This picks between E2E, Example or Demo
* app.
@@ -49,12 +69,28 @@ function _buildDemoAppInputTree() {
* @returns {Angular2App}
*/
function _buildAppTree(defaults) {
let inputNode = _buildDemoAppInputTree();
let inputNode;
let sourceDir;
switch(process.env['MD_APP']) {
case 'e2e':
inputNode = _buildE2EAppInputTree();
sourceDir = 'src/e2e-app';
break;
default:
inputNode = _buildDemoAppInputTree();
sourceDir = 'src/demo-app';
}
return new Angular2App(defaults, inputNode, {
sourceDir: 'src/demo-app',
tsCompiler: {
},
sourceDir: sourceDir,
polyfills: [
'vendor/es6-shim/es6-shim.js',
'vendor/reflect-metadata/Reflect.js',
'vendor/systemjs/dist/system.src.js',
'vendor/zone.js/dist/zone.js',
'vendor/hammerjs/hammer.min.js'
],
tsCompiler: {},
sassCompiler: {
includePaths: [
'src/core/style'
@@ -67,7 +103,8 @@ function _buildAppTree(defaults) {
'es6-shim/es6-shim.js',
'reflect-metadata/*.js',
'rxjs/**/*.js',
'@angular/**/*.js'
'@angular/**/*.js',
'hammerjs/*.min.+(js|js.map)'
]
});
}