Multiple Output Result Files with Jasmine Reporters

I have jasmine reporters set up and working fine with my tests, correctly writing the output to the path that I declare in each of the Conf.js files that I linked to each Spec file. Now I would like to know if I can write an output file for each individual BOM that runs as part of a package. (I am not using the "Suites" option.) So my conf.js file looks like this:

//Specs to use (All in folder)
specs: [
'.../**/*Spec.js'
],

onPrepare: function() {
//Setup Jasmine Reporters and output directory
require('<jasmine reporters path>')
var outputPath = "<my path>"
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(outputPath, true, true));
},

      

This will run all * Spec.js files in the folder I identified, but will of course overwrite the result after each Spec is run. What I would like to do is write a unique XML file for each Spec executable so that I can see the results from each individual Spec. Can this be done?

+3


source to share


1 answer


The closest one jasmine-reporters

offers what you ask for, this is an option consolidate

. If set false

, describe

a specific XML file will be generated for each block , but there is no way to create an XML file for each it

in your test case.



Creating a separate file for each specification can be tricky in cases where there are tests that are skipped / disabled, but if you think this is an important feature then consider creating a pull request with what you are looking for.

+2


source







All Articles