From c797a4ce335274d3aaa2a069fe00b9c90fae0882 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 23 Apr 2016 04:19:25 +0200 Subject: [PATCH] Fixed test report paths --- .gitignore | 8 +--- test/karma.conf.js | 108 +++++++++++++++++++------------------------- test/test-server.js | 10 ---- 3 files changed, 49 insertions(+), 77 deletions(-) diff --git a/.gitignore b/.gitignore index 9a8014e..7367a47 100644 --- a/.gitignore +++ b/.gitignore @@ -9,12 +9,8 @@ dist node_modules npm-debug.log -# Ignore mocha test data -test/data - -# Ignore example data -example/node_modules -example/npm-debug.log +# Ignore test reports +test/report # Ignore example cordova data example/app_mobile/platforms/* diff --git a/test/karma.conf.js b/test/karma.conf.js index fc105dd..852b9a0 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -1,63 +1,49 @@ module.exports = function(config) { - config.set({ - basePath: '..', - frameworks: ['jasmine', 'requirejs'], - files: [{ - pattern: 'es5-ff-spa-loader.js', - included: false - }, { - pattern: 'test/spec/**/*.js', - included: false - }, - 'test/spec-runner.js'], - - preprocessors: { - 'es5-ff-spa-loader.js': ['jshint','coverage'], - 'example/**/*.js': ['jshint'], - 'test/**/*.js': ['jshint'] - }, - reporters: ['coverage', 'mocha', 'junit'], - - // the default configuration - junitReporter: { - outputDir: 'test/data/coverage', // results will be saved as $outputDir/$browserName.xml - outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: '', // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element, - properties: {} // key value pair of properties to add to the section of the report - }, - - jshint: { - options: { - strict: true, - browser: true, - jasmine: true, - predef: ['define'] - }, - summary: true - }, - - plugins: [ - 'karma-requirejs', - 'karma-coverage', - 'karma-phantomjs-launcher', - 'karma-jasmine', - 'karma-jshint', - 'karma-mocha-reporter', - 'karma-junit-reporter' - ], - - coverageReporter: { - // specify a common output directory - dir: 'test/data/coverage', - reporters: [ - { type: 'lcov', subdir: 'report-lcov' }, - { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' } - ] - }, - - browsers: ['PhantomJS'] - }); + config.set({ + basePath : '..', + plugins : ['karma-requirejs', + 'karma-coverage', + 'karma-phantomjs-launcher', + 'karma-jasmine', + 'karma-jshint', + 'karma-mocha-reporter', + 'karma-junit-reporter' + ], + frameworks : [ 'jasmine', 'requirejs' ], + files : [ { + pattern : 'es5-ff-spa-loader.js', + included : false + }, { + pattern : 'test/spec/**/*.js', + included : false + }, 'test/spec-runner.js' ], + browsers : [ 'PhantomJS' ], + preprocessors : { + 'es5-ff-spa-loader.js' : [ 'jshint', 'coverage' ], + 'example/**/*.js' : [ 'jshint' ], + 'test/**/*.js' : [ 'jshint' ] + }, + reporters : [ 'coverage', 'mocha', 'junit' ], + coverageReporter : { + dir : 'test/report', + reporters : [ { + type : 'lcov', + subdir : '.' + } ] + }, + junitReporter : { + outputDir : 'test/report', + outputFile : 'TEST-karma.xml', + useBrowserName : false, + }, + jshint : { + options : { + strict : true, + browser : true, + jasmine : true, + predef : [ 'define' ] + }, + summary : true + } + }); }; \ No newline at end of file diff --git a/test/test-server.js b/test/test-server.js index b1efc4a..eb92976 100644 --- a/test/test-server.js +++ b/test/test-server.js @@ -92,16 +92,8 @@ function renderIndex() { // Add resources ORDERED per type addClientResource('/static/module/jquery/jquery.js','js'); -//addClientResource('/static/module/angular/angular.js','js'); -//addClientResource('/static/module/angular-route/angular-route.js','js'); addClientResource('/static/module/bootstrap/css/bootstrap.css','css'); addClientResource('/static/module/bootstrap/js/bootstrap.js','js'); -//addClientResource('/static/css/boot.css','css'); -//addClientResource('/static/css/style.css','css'); -//addClientResource('/static/js/example-app.js','js'); // deps: jquery,angular -//addClientResource('/static/js/controller/page-bar.js','js'); // deps: example-app.js -//addClientResource('/static/js/controller/page-foo.js','js'); -//addClientResource('/static/js/controller/page-index.js','js'); var appPath = '/test'; var server = express(); @@ -113,8 +105,6 @@ server.use(function(req, res, next) { res.header('X-My-Api', 'nokno server.use(appPath+'/static', express.static(path.join(__dirname,'www_static'))); server.use(appPath+'/static/module/bootstrap', express.static(path.join(__dirname,'../node_modules/bootstrap/dist'))); server.use(appPath+'/static/module/jquery', express.static(path.join(__dirname,'../node_modules/jquery/dist'))); -server.use(appPath+'/static/module/angular', express.static(path.join(__dirname,'../node_modules/angular'))); -server.use(appPath+'/static/module/angular-route', express.static(path.join(__dirname,'../node_modules/angular-route'))); server.get(appPath+'/static/spa-client-resources', function (req,res) {res.json({data: {resources: clientResourcesWeb}});}); server.get(appPath+'/static/spa-loader.css', function (req,res) {res.sendFile('es5-ff-spa-loader.css', { root: path.join(__dirname, '/../../') });}); server.get(appPath+'/', function (req, res) {res.redirect(appPath+'/example-ui');});