From 9b2c576fb5754020b38eeaf597219d24c3b2af5c Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Fri, 23 Sep 2016 10:15:50 +0100 Subject: [PATCH] Upgrade ng2-activiti-process-list and ng2-activiti-form --- .../ng2-activiti-form/karma-test-shim.js | 173 ++++++++-------- .../ng2-activiti-form/karma.conf.js | 57 ++++-- .../karma-test-shim.js | 184 ++++++++++-------- .../ng2-activiti-processlist/karma.conf.js | 91 ++++++--- .../src/components/placeholder.spec.ts | 22 +++ 5 files changed, 327 insertions(+), 200 deletions(-) create mode 100644 ng2-components/ng2-activiti-processlist/src/components/placeholder.spec.ts diff --git a/ng2-components/ng2-activiti-form/karma-test-shim.js b/ng2-components/ng2-activiti-form/karma-test-shim.js index 2d378ec947..9662cebf0a 100644 --- a/ng2-components/ng2-activiti-form/karma-test-shim.js +++ b/ng2-components/ng2-activiti-form/karma-test-shim.js @@ -5,103 +5,122 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; __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 = { 'app': 'base/dist', - 'rxjs': 'base/node_modules/rxjs', - '@angular': 'base/node_modules/@angular', - 'ng2-alfresco-core': '/base/node_modules/ng2-alfresco-core/dist', - 'ng2-translate' : '/base/node_modules/ng2-translate' + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@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 = { 'app': { main: 'main.js', defaultExtension: 'js' }, - 'rxjs': { defaultExtension: 'js' }, - 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' }, - 'ng2-translate': { defaultExtension: 'js' } -}; + 'rxjs': { defaultExtension: 'js' }, + 'ng2-translate': { defaultExtension: 'js' }, -var packageNames = [ - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@angular/router-deprecated', - '@angular/testing', - '@angular/upgrade' -]; - -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, {}) + 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, + 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} }; var config = { + paths: paths, map: map, packages: packages }; System.config(config); -System.import('@angular/platform-browser/src/browser/browser_adapter') - .then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) - .then(function () { - return Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') - ]) - }) +System.import('@angular/core/testing') + .then(initTestBed) + .then(initTesting); + +function initTestBed(){ + return Promise.all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') + ]) .then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; - - testing.setBaseTestProviders( - testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); + var coreTesting = providers[0]; + var browserTesting = providers[1]; + 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) { - return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); -} - -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') +// Import all spec files and start karma +function initTesting () { + return Promise.all( + allSpecFiles.map(function (moduleName) { return System.import(moduleName); - }); + }) + ) + .then(__karma__.start, __karma__.error); } diff --git a/ng2-components/ng2-activiti-form/karma.conf.js b/ng2-components/ng2-activiti-form/karma.conf.js index 40bb7d31ca..2aa3ff5612 100644 --- a/ng2-components/ng2-activiti-form/karma.conf.js +++ b/ng2-components/ng2-activiti-form/karma.conf.js @@ -7,25 +7,56 @@ module.exports = function (config) { frameworks: ['jasmine-ajax', 'jasmine'], files: [ - // paths loaded by Karma - {pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true}, - {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}, + // System.js for module loading + 'node_modules/systemjs/dist/system.src.js', - {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 {pattern: 'dist/**/*.js', included: false, watched: true}, {pattern: 'dist/**/*.html', 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 {pattern: 'src/**/*.ts', 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. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + // 'dist/**/!(*spec).js': ['coverage'] }, coverageReporter: { diff --git a/ng2-components/ng2-activiti-processlist/karma-test-shim.js b/ng2-components/ng2-activiti-processlist/karma-test-shim.js index 8c7ba100a2..9662cebf0a 100644 --- a/ng2-components/ng2-activiti-processlist/karma-test-shim.js +++ b/ng2-components/ng2-activiti-processlist/karma-test-shim.js @@ -5,104 +5,122 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; __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 = { - 'app': 'base/dist', - 'rxjs': 'base/node_modules/rxjs', - '@angular': 'base/node_modules/@angular', - 'ng2-alfresco-core': '/base/node_modules/ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': '/base/node_modules/ng2-alfresco-datatable/dist', - 'ng2-translate' : '/base/node_modules/ng2-translate' + 'app': 'base/dist', + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@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 = { - 'app': { main: 'main.js', defaultExtension: 'js' }, - 'rxjs': { defaultExtension: 'js' }, - 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' }, - 'ng2-alfresco-datatable': { main: 'index.js', defaultExtension: 'js' }, - 'ng2-translate': { defaultExtension: 'js' } -}; + 'app': { main: 'main.js', defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' }, + 'ng2-translate': { defaultExtension: 'js' }, -var packageNames = [ - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@angular/router-deprecated', - '@angular/testing', - '@angular/upgrade' -]; - -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, {}) + 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, + 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} }; var config = { - map: map, - packages: packages + paths: paths, + map: map, + packages: packages }; System.config(config); -System.import('@angular/platform-browser/src/browser/browser_adapter') - .then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) - .then(function () { +System.import('@angular/core/testing') + .then(initTestBed) + .then(initTesting); + +function initTestBed(){ return Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') ]) - }) - .then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; + .then(function (providers) { + var coreTesting = providers[0]; + var browserTesting = providers[1]; - testing.setBaseTestProviders( - testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); - }) - .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; + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); + }) } -function onlyAppFiles(filePath) { - return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); -} - -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); - }); +// Import all spec files and start karma +function initTesting () { + return Promise.all( + allSpecFiles.map(function (moduleName) { + return System.import(moduleName); + }) + ) + .then(__karma__.start, __karma__.error); } diff --git a/ng2-components/ng2-activiti-processlist/karma.conf.js b/ng2-components/ng2-activiti-processlist/karma.conf.js index 459fe5f79c..f6004cd36b 100644 --- a/ng2-components/ng2-activiti-processlist/karma.conf.js +++ b/ng2-components/ng2-activiti-processlist/karma.conf.js @@ -1,54 +1,77 @@ 'use strict'; module.exports = function (config) { - config.set({ - + var configuration = { basePath: '.', - frameworks: ['jasmine'], + frameworks: ['jasmine-ajax', 'jasmine'], files: [ - // paths loaded by Karma - {pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true}, - {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}, + // System.js for module loading + 'node_modules/systemjs/dist/system.src.js', - {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 {pattern: 'dist/**/*.js', included: false, watched: true}, {pattern: 'dist/**/*.html', 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 {pattern: 'src/**/*.ts', included: false, watched: false}, {pattern: 'dist/**/*.js.map', included: false, watched: false} ], + exclude: [ + 'node_modules/**/*spec.js' + ], + // proxied base paths proxies: { // required for component assets fetched by Angular's compiler '/src/': '/base/src/' }, - // list of files to exclude - exclude: [ - 'node_modules/**/*spec.js' - ], - port: 9876, // level of logging @@ -61,10 +84,18 @@ module.exports = function (config) { browsers: ['Chrome'], + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + // Karma plugins loaded plugins: [ 'karma-jasmine', 'karma-coverage', + 'karma-jasmine-ajax', 'karma-chrome-launcher', 'karma-mocha-reporter', 'karma-jasmine-html-reporter' @@ -89,5 +120,11 @@ module.exports = function (config) { {type: 'lcov'} ] } - }) + }; + + if (process.env.TRAVIS) { + configuration.browsers = ['Chrome_travis_ci']; + } + + config.set(configuration) }; diff --git a/ng2-components/ng2-activiti-processlist/src/components/placeholder.spec.ts b/ng2-components/ng2-activiti-processlist/src/components/placeholder.spec.ts new file mode 100644 index 0000000000..160a6a7451 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/src/components/placeholder.spec.ts @@ -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); + }); +});