2
0
Fork 0

Fixed test report paths

This commit is contained in:
Willem 2016-04-23 04:19:25 +02:00
parent 583b7d8cc3
commit c797a4ce33
3 changed files with 49 additions and 77 deletions

8
.gitignore vendored
View file

@ -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/*

View file

@ -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 <properties> 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
}
});
};

View file

@ -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');});