You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been generated the coverage report as JSON reports and then converted them to HTML report with https://www.npmjs.com/package/istanbul-combine I have configured the gulp tool to preform multiple tasks for all test cases folders. I am here by to share an sample gulp tasks for one of my folder,
After test case execution, the test result for the folder will generate in "cireports/nunit/..."
But in my source, only TestResult.html only generated, the bootstrap and JQuery was not created in that Nunit folders with karma-html-detailed-reporter. Even though, if i set the "useHostedBootstrap: true" value to true, the bootstrap and JQuery files was not created in my unit folder.
The following code shows the reporter.js file default code :
karma-html-detailed-reporter/lib/reporter.js:-
` if (useHosted) {
template = template.replace(/\{\{jquery_Path\}\}/g, 'https://code.jquery.com');
template = template.replace(/\{\{bootstrap_Path\}\}/g,
'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7');
} else {
var basePaths = getRelativePaths();
template = template.replace(/\{\{jquery_Path\}\}/g, basePaths.jquery);
template = template.replace(/\{\{bootstrap_Path\}\}/g, basePaths.bootstrap);
}
.........
.........
function getRelativePaths() {
var paths = {};
// Get bootstrap's path
var bootstrap = require.resolve('bootstrap');
if (!bootstrap) log.error('Bootstrap is not found!');
else {
bootstrap = require('path').dirname(bootstrap);
bootstrap = splitResults ? path.relative(outputDir + '/tempFolder/', bootstrap) :
path.relative(outputDir, bootstrap);
paths.bootstrap = bootstrap.substring(0, bootstrap.indexOf("\\js")).replace(/\\/g, '/'); // <-
This gives the path of the '/js' subfolder of bootstrap, so we need to go one level up
}
// Get jquery's path
var jquery = require.resolve('jquery');
if (!jquery) log.error('jQuery is not found!');
else {
jquery = require('path').dirname(jquery);
paths.jquery = (splitResults ? path.relative(outputDir + '/tempFolder/', jquery) :
path.relative(outputDir, jquery)).replace(/\\/g, '/');
}
log.debug('Paths: ', paths);
return paths;
}
`
In above code, I want to refer custom JQuery and bootstrap location with my source. because useHostedBootstrap was not working in karma-html-detailed-reporter. That's why I've switched into custom location for JQuery and bootstratp. My bootstrap and JQuery paths are,
I am new to TDD. Currently I had running more than 2000 test cases parallel with chrome headless browser using https://www.npmjs.com/package/concurrently .The test case are all working fine. If any of the test cases get failed means, i have found the test result for each folder with https://github.com/a11smiles/karma-html-detailed-reporter
I have been generated the coverage report as JSON reports and then converted them to HTML report with https://www.npmjs.com/package/istanbul-combine I have configured the gulp tool to preform multiple tasks for all test cases folders. I am here by to share an sample gulp tasks for one of my folder,
gulp.js file :
I have multiple karma-configuration files for each test case folders. I am hereby share one of my karma configuration file.
karma.config.js :
` module.exports = function(config) {
package.JSON :
After test case execution, the test result for the folder will generate in
"cireports/nunit/..."
But in my source, only
TestResult.html
only generated, the bootstrap and JQuery was not created in that Nunit folders with karma-html-detailed-reporter. Even though, if i set the"useHostedBootstrap: true"
value to true, the bootstrap and JQuery files was not created in my unit folder.The following code shows the
reporter.js
file default code :karma-html-detailed-reporter/lib/reporter.js:-
In above code, I want to refer custom JQuery and bootstrap location with my source. because
useHostedBootstrap
was not working inkarma-html-detailed-reporter
. That's why I've switched into custom location for JQuery and bootstratp. My bootstrap and JQuery paths are,Bootstrap.min.js :
"My_Folder\cireports\bootstrap\dist\js\bootstrap.min.js"
Bootstrap.min.css :
"My_Folder\cireports\bootstrap\dist\css\bootstrap.min.css"
jquery.min.js :
"My_Folder\node_modules\jquery\dist\jquery.min.js"
Could any one tell me, how to refer my locations in
karma-html-detailed-reporter/lib/reporter.js
file?Regards,
Creator
`
The text was updated successfully, but these errors were encountered: