Set TEST_JUNIT_RUN to the current suite name

This commit is contained in:
Ash Wilson
2019-02-12 11:59:20 -05:00
parent fea3286ca8
commit 50b8dad3b9

View File

@@ -68,9 +68,9 @@ function prepareEnv (suiteName) {
if (process.env.TEST_JUNIT_XML_ROOT) {
// Tell Jasmine to output this suite's results as a JUnit XML file to a subdirectory of the root, so that a
// CI system can interpret it.
const runPrefix = process.env.TEST_JUNIT_XML_RUN || ''
const filePath = (runPrefix.length > 0 ? runPrefix + ' ' : '') + suiteName + '.xml'
const outputPath = path.join(process.env.TEST_JUNIT_XML_ROOT, filePath)
env.TEST_JUNIT_RUN = suiteName
const fileName = suiteName.replace(/\W+/g, '-') + '.xml'
const outputPath = path.join(process.env.TEST_JUNIT_XML_ROOT, fileName)
env.TEST_JUNIT_XML_PATH = outputPath
}