From c87588ebcfe838b65d94730fb87dc875bd13d092 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Sat, 25 Mar 2017 06:36:38 +0100 Subject: [PATCH] Fix setup after ng4 changes --- project-manager/.angular-cli.json | 2 +- project-manager/.karma.conf.js | 74 ------------------- project-manager/package.json | 2 + .../protractor-html-reporter.conf.js | 52 ------------- 4 files changed, 3 insertions(+), 127 deletions(-) delete mode 100644 project-manager/.karma.conf.js delete mode 100644 project-manager/protractor-html-reporter.conf.js diff --git a/project-manager/.angular-cli.json b/project-manager/.angular-cli.json index ad51b42..0ee7bb7 100644 --- a/project-manager/.angular-cli.json +++ b/project-manager/.angular-cli.json @@ -46,7 +46,7 @@ }, "test": { "karma": { - "config": "./.karma.conf.js" + "config": "./karma.conf.js" } }, "defaults": { diff --git a/project-manager/.karma.conf.js b/project-manager/.karma.conf.js deleted file mode 100644 index a3bd032..0000000 --- a/project-manager/.karma.conf.js +++ /dev/null @@ -1,74 +0,0 @@ -// Karma configuration -// Generated on Sat Mar 25 2017 06:01:47 GMT+0100 (CET) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine'], - - - // list of files / patterns to load in the browser - files: [ - './src/**/*.spec.ts' - ], - - - // list of files to exclude - exclude: [ - ], - - // Redefine default mapping from file extensions to MIME-type - // Set property name to required MIME, provide Array of extensions (without dots) as it's value - mime: { - 'text/x-typescript': ['ts','tsx'] - }, - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - }, - - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }) -} diff --git a/project-manager/package.json b/project-manager/package.json index ecdca6f..55518b1 100644 --- a/project-manager/package.json +++ b/project-manager/package.json @@ -44,6 +44,8 @@ "@types/socket.io-client": "^1.4.26", "codelyzer": "~2.0.0-beta.1", "concurrently": "^2.0.0", + "jasmine-core": "^2.5.2", + "karma": "^1.5.0", "karma-chrome-launcher": "^2.0.0", "karma-jasmine": "^1.1.0", "ts-node": "1.2.1", diff --git a/project-manager/protractor-html-reporter.conf.js b/project-manager/protractor-html-reporter.conf.js deleted file mode 100644 index b9360f8..0000000 --- a/project-manager/protractor-html-reporter.conf.js +++ /dev/null @@ -1,52 +0,0 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/docs/referenceConf.js - -/*global jasmine */ -var SpecReporter = require('jasmine-spec-reporter'); -//var ScreenshotProcessor = require('./e2e/helpers/screen_shot_reporter.ts'); -var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); - -var reporter = new HtmlScreenshotReporter({ - dest: 'tmp/screenshots', - filename: 'test-report.html', - cleanDestination: true, - ignoreSkippedSpecs: true, - captureOnlyFailedSpecs: false -}); - - -exports.config = { - allScriptsTimeout: 11000, - specs: [ - './e2e/**/*.e2e-spec.ts' - ], - capabilities: { - 'browserName': 'firefox' - }, - directConnect: true, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function() {} - }, - useAllAngular2AppRoots: true, - beforeLaunch: function() { - require('ts-node').register({ - project: 'e2e' - }); - return new Promise(function(resolve){ - reporter.beforeLaunch(resolve); - }); - }, - afterLaunch: function(exitCode) { - return new Promise(function(resolve){ - reporter.afterLaunch(resolve.bind(this, exitCode)); - }); - }, - onPrepare: function() { - jasmine.getEnv().addReporter(reporter); - jasmine.getEnv().addReporter(new SpecReporter()); - }, -}; \ No newline at end of file