From 89ba802b23bf1fd22afbc5e9a4b3b732264e3c18 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 4 Nov 2014 15:57:23 +0000 Subject: Move webclient to a python module so that it can be installed --- syweb/webclient/test/karma.conf.js | 91 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 syweb/webclient/test/karma.conf.js (limited to 'syweb/webclient/test/karma.conf.js') diff --git a/syweb/webclient/test/karma.conf.js b/syweb/webclient/test/karma.conf.js new file mode 100644 index 0000000000..083c7c7200 --- /dev/null +++ b/syweb/webclient/test/karma.conf.js @@ -0,0 +1,91 @@ +// Karma configuration +// Generated on Thu Sep 18 2014 14:25:57 GMT+0100 (BST) + +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 + // XXX: Order is important, and doing /js/angular* makes the tests not run :/ + files: [ + '../js/jquery*', + '../js/angular.js', + '../js/angular-mocks.js', + '../js/angular-route.js', + '../js/angular-animate.js', + '../js/angular-sanitize.js', + '../js/ng-infinite-scroll-matrix.js', + '../js/ui-bootstrap*', + '../js/elastic.js', + '../login/**/*.*', + '../room/**/*.*', + '../components/**/*.*', + '../user/**/*.*', + '../home/**/*.*', + '../recents/**/*.*', + '../settings/**/*.*', + '../app.js', + '../app*', + './unit/**/*.js' + ], + + plugins: [ + 'karma-*', + ], + + + // list of files to exclude + exclude: [ + ], + + + // 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', 'junit'], + junitReporter: { + outputFile: 'test-results.xml', + suite: '' + }, + + // 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_DEBUG, + + + // 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: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true + }); +}; -- cgit 1.5.1 From 746525014110b4aef2eb00ba9b09714c3c8c5c77 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 6 Nov 2014 09:34:35 +0000 Subject: State *.js in karma.conf rather than *.* so *.js~ files are ignored. --- syweb/webclient/test/karma.conf.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'syweb/webclient/test/karma.conf.js') diff --git a/syweb/webclient/test/karma.conf.js b/syweb/webclient/test/karma.conf.js index 083c7c7200..7ce958adc9 100644 --- a/syweb/webclient/test/karma.conf.js +++ b/syweb/webclient/test/karma.conf.js @@ -25,13 +25,13 @@ module.exports = function(config) { '../js/ng-infinite-scroll-matrix.js', '../js/ui-bootstrap*', '../js/elastic.js', - '../login/**/*.*', - '../room/**/*.*', - '../components/**/*.*', - '../user/**/*.*', - '../home/**/*.*', - '../recents/**/*.*', - '../settings/**/*.*', + '../login/**/*.js', + '../room/**/*.js', + '../components/**/*.js', + '../user/**/*.js', + '../home/**/*.js', + '../recents/**/*.js', + '../settings/**/*.js', '../app.js', '../app*', './unit/**/*.js' -- cgit 1.5.1 From d669eb6d054fb49714ca0d4a5c551188e50765f6 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 11 Nov 2014 04:45:32 +0000 Subject: add new peity dep to tests --- syweb/webclient/test/karma.conf.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'syweb/webclient/test/karma.conf.js') diff --git a/syweb/webclient/test/karma.conf.js b/syweb/webclient/test/karma.conf.js index 7ce958adc9..5f0642ca33 100644 --- a/syweb/webclient/test/karma.conf.js +++ b/syweb/webclient/test/karma.conf.js @@ -22,6 +22,8 @@ module.exports = function(config) { '../js/angular-route.js', '../js/angular-animate.js', '../js/angular-sanitize.js', + '../js/jquery.peity.min.js', + '../js/angular-peity.js', '../js/ng-infinite-scroll-matrix.js', '../js/ui-bootstrap*', '../js/elastic.js', -- cgit 1.5.1 From 3d3f692fd8a3fe07daf2f5b8811ebc00846b60c1 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 12 Nov 2014 16:22:14 +0000 Subject: Add test coverage to the webclient. Update .gitignore --- .gitignore | 3 ++- syweb/webclient/components/matrix/matrix-service.js | 2 +- syweb/webclient/test/karma.conf.js | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'syweb/webclient/test/karma.conf.js') diff --git a/.gitignore b/.gitignore index 3d14ac8c03..339a99e0d6 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ graph/*.png graph/*.dot **/webclient/config.js -webclient/test/environment-protractor.js +**/webclient/test/coverage/ +**/webclient/test/environment-protractor.js uploads diff --git a/syweb/webclient/components/matrix/matrix-service.js b/syweb/webclient/components/matrix/matrix-service.js index c1264887c8..cfe8691f85 100644 --- a/syweb/webclient/components/matrix/matrix-service.js +++ b/syweb/webclient/components/matrix/matrix-service.js @@ -23,7 +23,7 @@ This serves to isolate the caller from changes to the underlying url paths, as well as attach common params (e.g. access_token) to requests. */ angular.module('matrixService', []) -.factory('matrixService', ['$http', '$q', '$rootScope', function($http, $q, $rootScope) { +.factory('matrixService', ['$http', '$q', function($http, $q) { /* * Permanent storage of user information diff --git a/syweb/webclient/test/karma.conf.js b/syweb/webclient/test/karma.conf.js index 5f0642ca33..37a9eaf1c1 100644 --- a/syweb/webclient/test/karma.conf.js +++ b/syweb/webclient/test/karma.conf.js @@ -52,18 +52,32 @@ module.exports = function(config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { + '../login/**/*.js': 'coverage', + '../room/**/*.js': 'coverage', + '../components/**/*.js': 'coverage', + '../user/**/*.js': 'coverage', + '../home/**/*.js': 'coverage', + '../recents/**/*.js': 'coverage', + '../settings/**/*.js': 'coverage', + '../app.js': 'coverage' }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress', 'junit'], + reporters: ['progress', 'junit', 'coverage'], junitReporter: { outputFile: 'test-results.xml', suite: '' }, + coverageReporter: { + type: 'cobertura', + dir: 'coverage/', + file: 'coverage.xml' + }, + // web server port port: 9876, -- cgit 1.5.1