Upgrade ng2-activiti-process-list and ng2-activiti-form

This commit is contained in:
Denys Vuika 2016-09-23 10:15:50 +01:00
parent 1276cb50a9
commit 9b2c576fb5
5 changed files with 327 additions and 200 deletions

View File

@ -5,103 +5,122 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
__karma__.loaded = function() {}; __karma__.loaded = function() {};
var builtPath = '/base/dist/';
function isJsFile(path) {
return path.slice(-3) == '.js';
}
function isSpecFile(path) {
return /\.spec\.(.*\.)?js$/.test(path);
}
function isBuiltFile(path) {
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
}
var allSpecFiles = Object.keys(window.__karma__.files)
.filter(isSpecFile)
.filter(isBuiltFile);
var paths = {
// paths serve as alias
'npm:': 'base/node_modules/'
};
var map = { var map = {
'app': 'base/dist', 'app': 'base/dist',
'rxjs': 'base/node_modules/rxjs', // angular bundles
'@angular': 'base/node_modules/@angular', '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'ng2-alfresco-core': '/base/node_modules/ng2-alfresco-core/dist', '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'ng2-translate' : '/base/node_modules/ng2-translate' '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// testing
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'ng2-translate': 'npm:ng2-translate',
'alfresco-js-api': 'npm:alfresco-js-api/dist',
'ng2-activiti-form': 'npm:ng2-activiti-form/dist',
'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist',
'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist',
'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist',
'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist',
'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist',
'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist',
'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist',
'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist',
'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist',
'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist',
'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist'
}; };
var packages = { var packages = {
'app': { main: 'main.js', defaultExtension: 'js' }, 'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' },
'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' }
};
var packageNames = [ 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
'@angular/common', 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'},
'@angular/compiler', 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'},
'@angular/core', 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'},
'@angular/http', 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
'@angular/platform-browser', 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'},
'@angular/platform-browser-dynamic', 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'},
'@angular/router', 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'},
'@angular/router-deprecated', 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'},
'@angular/testing', 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'},
'@angular/upgrade' 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'},
]; 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'}
packageNames.forEach(function(pkgName) {
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
});
packages['base/dist'] = {
defaultExtension: 'js',
format: 'register',
map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
}; };
var config = { var config = {
paths: paths,
map: map, map: map,
packages: packages packages: packages
}; };
System.config(config); System.config(config);
System.import('@angular/platform-browser/src/browser/browser_adapter') System.import('@angular/core/testing')
.then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) .then(initTestBed)
.then(function () { .then(initTesting);
return Promise.all([
System.import('@angular/core/testing'), function initTestBed(){
System.import('@angular/platform-browser-dynamic/testing') return Promise.all([
]) System.import('@angular/core/testing'),
}) System.import('@angular/platform-browser-dynamic/testing')
])
.then(function (providers) { .then(function (providers) {
var testing = providers[0]; var coreTesting = providers[0];
var testingBrowser = providers[1]; var browserTesting = providers[1];
testing.setBaseTestProviders(
testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
coreTesting.TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule,
browserTesting.platformBrowserDynamicTesting());
}) })
.then(function() { return Promise.all(resolveTestFiles()); })
.then(
function() {
__karma__.start();
},
function(error) {
if(typeof __karma__.error == 'function') {
__karma__.error(error.stack || error);
}else{
console.error(error);
}
}
);
function createPathRecords(pathsMapping, appPath) {
var pathParts = appPath.split('/');
var moduleName = './' + pathParts.slice(Math.max(pathParts.length - 2, 1)).join('/');
moduleName = moduleName.replace(/\.js$/, '');
pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath];
return pathsMapping;
} }
function onlyAppFiles(filePath) { // Import all spec files and start karma
return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); function initTesting () {
} return Promise.all(
allSpecFiles.map(function (moduleName) {
function onlySpecFiles(path) {
return /\.spec\.js$/.test(path);
}
function resolveTestFiles() {
return Object.keys(window.__karma__.files) // All files served by Karma.
.filter(onlySpecFiles)
.map(function(moduleName) {
// loads all spec files via their global module names (e.g.
// 'base/dist/vg-player/vg-player.spec')
return System.import(moduleName); return System.import(moduleName);
}); })
)
.then(__karma__.start, __karma__.error);
} }

View File

@ -7,25 +7,56 @@ module.exports = function (config) {
frameworks: ['jasmine-ajax', 'jasmine'], frameworks: ['jasmine-ajax', 'jasmine'],
files: [ files: [
// paths loaded by Karma // System.js for module loading
{pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true}, 'node_modules/systemjs/dist/system.src.js',
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: true},
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
{pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false},
{pattern: 'karma-test-shim.js', included: true, watched: true}, // Polyfills
'node_modules/core-js/client/shim.js',
'node_modules/reflect-metadata/Reflect.js',
// zone.js
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/zone.js/dist/proxy.js',
'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
// RxJs
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
// Paths loaded via module imports:
// Angular itself
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
'node_modules/alfresco-js-api/dist/alfresco-js-api.js',
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false},
{pattern: 'node_modules/ng2-translate/**/*.js.map', included: false, watched: false},
'karma-test-shim.js',
// paths loaded via module imports // paths loaded via module imports
{pattern: 'dist/**/*.js', included: false, watched: true}, {pattern: 'dist/**/*.js', included: false, watched: true},
{pattern: 'dist/**/*.html', included: true, served: true, watched: true}, {pattern: 'dist/**/*.html', included: true, served: true, watched: true},
{pattern: 'dist/**/*.css', included: true, served: true, watched: true}, {pattern: 'dist/**/*.css', included: true, served: true, watched: true},
// ng2-components
{ pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false },
// paths to support debugging with source maps in dev tools // paths to support debugging with source maps in dev tools
{pattern: 'src/**/*.ts', included: false, watched: false}, {pattern: 'src/**/*.ts', included: false, watched: false},
{pattern: 'dist/**/*.js.map', included: false, watched: false} {pattern: 'dist/**/*.js.map', included: false, watched: false}
@ -76,7 +107,7 @@ module.exports = function (config) {
// Source files that you wanna generate coverage for. // Source files that you wanna generate coverage for.
// Do not include tests or libraries (these files will be instrumented by Istanbul) // Do not include tests or libraries (these files will be instrumented by Istanbul)
preprocessors: { preprocessors: {
'dist/**/!(*spec).js': ['coverage'] // 'dist/**/!(*spec).js': ['coverage']
}, },
coverageReporter: { coverageReporter: {

View File

@ -5,104 +5,122 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
__karma__.loaded = function() {}; __karma__.loaded = function() {};
var builtPath = '/base/dist/';
function isJsFile(path) {
return path.slice(-3) == '.js';
}
function isSpecFile(path) {
return /\.spec\.(.*\.)?js$/.test(path);
}
function isBuiltFile(path) {
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
}
var allSpecFiles = Object.keys(window.__karma__.files)
.filter(isSpecFile)
.filter(isBuiltFile);
var paths = {
// paths serve as alias
'npm:': 'base/node_modules/'
};
var map = { var map = {
'app': 'base/dist', 'app': 'base/dist',
'rxjs': 'base/node_modules/rxjs', // angular bundles
'@angular': 'base/node_modules/@angular', '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'ng2-alfresco-core': '/base/node_modules/ng2-alfresco-core/dist', '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'ng2-alfresco-datatable': '/base/node_modules/ng2-alfresco-datatable/dist', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'ng2-translate' : '/base/node_modules/ng2-translate' '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// testing
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'ng2-translate': 'npm:ng2-translate',
'alfresco-js-api': 'npm:alfresco-js-api/dist',
'ng2-activiti-form': 'npm:ng2-activiti-form/dist',
'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist',
'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist',
'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist',
'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist',
'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist',
'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist',
'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist',
'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist',
'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist',
'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist',
'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist'
}; };
var packages = { var packages = {
'app': { main: 'main.js', defaultExtension: 'js' }, 'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' },
'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-datatable': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' }
};
var packageNames = [ 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
'@angular/common', 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'},
'@angular/compiler', 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'},
'@angular/core', 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'},
'@angular/http', 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
'@angular/platform-browser', 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'},
'@angular/platform-browser-dynamic', 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'},
'@angular/router', 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'},
'@angular/router-deprecated', 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'},
'@angular/testing', 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'},
'@angular/upgrade' 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'},
]; 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'},
'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'}
packageNames.forEach(function(pkgName) {
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
});
packages['base/dist'] = {
defaultExtension: 'js',
format: 'register',
map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
}; };
var config = { var config = {
map: map, paths: paths,
packages: packages map: map,
packages: packages
}; };
System.config(config); System.config(config);
System.import('@angular/platform-browser/src/browser/browser_adapter') System.import('@angular/core/testing')
.then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) .then(initTestBed)
.then(function () { .then(initTesting);
function initTestBed(){
return Promise.all([ return Promise.all([
System.import('@angular/core/testing'), System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing') System.import('@angular/platform-browser-dynamic/testing')
]) ])
}) .then(function (providers) {
.then(function (providers) { var coreTesting = providers[0];
var testing = providers[0]; var browserTesting = providers[1];
var testingBrowser = providers[1];
testing.setBaseTestProviders( coreTesting.TestBed.initTestEnvironment(
testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, browserTesting.BrowserDynamicTestingModule,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); browserTesting.platformBrowserDynamicTesting());
}) })
.then(function() { return Promise.all(resolveTestFiles()); })
.then(
function() {
__karma__.start();
},
function(error) {
if(typeof __karma__.error == 'function') {
__karma__.error(error.stack || error);
}else{
console.error(error);
}
}
);
function createPathRecords(pathsMapping, appPath) {
var pathParts = appPath.split('/');
var moduleName = './' + pathParts.slice(Math.max(pathParts.length - 2, 1)).join('/');
moduleName = moduleName.replace(/\.js$/, '');
pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath];
return pathsMapping;
} }
function onlyAppFiles(filePath) { // Import all spec files and start karma
return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); function initTesting () {
} return Promise.all(
allSpecFiles.map(function (moduleName) {
function onlySpecFiles(path) { return System.import(moduleName);
return /\.spec\.js$/.test(path); })
} )
.then(__karma__.start, __karma__.error);
function resolveTestFiles() {
return Object.keys(window.__karma__.files) // All files served by Karma.
.filter(onlySpecFiles)
.map(function(moduleName) {
// loads all spec files via their global module names (e.g.
// 'base/dist/vg-player/vg-player.spec')
return System.import(moduleName);
});
} }

View File

@ -1,54 +1,77 @@
'use strict'; 'use strict';
module.exports = function (config) { module.exports = function (config) {
config.set({ var configuration = {
basePath: '.', basePath: '.',
frameworks: ['jasmine'], frameworks: ['jasmine-ajax', 'jasmine'],
files: [ files: [
// paths loaded by Karma // System.js for module loading
{pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true}, 'node_modules/systemjs/dist/system.src.js',
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: true},
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
{pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.html', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.css', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.html', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.css', included: false, served: true, watched: false},
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
{pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false},
{pattern: 'karma-test-shim.js', included: true, watched: true}, // Polyfills
'node_modules/core-js/client/shim.js',
'node_modules/reflect-metadata/Reflect.js',
// zone.js
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/zone.js/dist/proxy.js',
'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
// RxJs
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
// Paths loaded via module imports:
// Angular itself
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
'node_modules/alfresco-js-api/dist/alfresco-js-api.js',
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false},
{pattern: 'node_modules/ng2-translate/**/*.js.map', included: false, watched: false},
'karma-test-shim.js',
// paths loaded via module imports // paths loaded via module imports
{pattern: 'dist/**/*.js', included: false, watched: true}, {pattern: 'dist/**/*.js', included: false, watched: true},
{pattern: 'dist/**/*.html', included: true, served: true, watched: true}, {pattern: 'dist/**/*.html', included: true, served: true, watched: true},
{pattern: 'dist/**/*.css', included: true, served: true, watched: true}, {pattern: 'dist/**/*.css', included: true, served: true, watched: true},
// ng2-components
{ pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false },
{ pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false },
// paths to support debugging with source maps in dev tools // paths to support debugging with source maps in dev tools
{pattern: 'src/**/*.ts', included: false, watched: false}, {pattern: 'src/**/*.ts', included: false, watched: false},
{pattern: 'dist/**/*.js.map', included: false, watched: false} {pattern: 'dist/**/*.js.map', included: false, watched: false}
], ],
exclude: [
'node_modules/**/*spec.js'
],
// proxied base paths // proxied base paths
proxies: { proxies: {
// required for component assets fetched by Angular's compiler // required for component assets fetched by Angular's compiler
'/src/': '/base/src/' '/src/': '/base/src/'
}, },
// list of files to exclude
exclude: [
'node_modules/**/*spec.js'
],
port: 9876, port: 9876,
// level of logging // level of logging
@ -61,10 +84,18 @@ module.exports = function (config) {
browsers: ['Chrome'], browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
// Karma plugins loaded // Karma plugins loaded
plugins: [ plugins: [
'karma-jasmine', 'karma-jasmine',
'karma-coverage', 'karma-coverage',
'karma-jasmine-ajax',
'karma-chrome-launcher', 'karma-chrome-launcher',
'karma-mocha-reporter', 'karma-mocha-reporter',
'karma-jasmine-html-reporter' 'karma-jasmine-html-reporter'
@ -89,5 +120,11 @@ module.exports = function (config) {
{type: 'lcov'} {type: 'lcov'}
] ]
} }
}) };
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}
config.set(configuration)
}; };

View File

@ -0,0 +1,22 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
describe('Placeholder', () => {
it('test placeholder', () => {
expect(true).toBe(true);
});
});