Skip to content

Commit

Permalink
feat: image-modal-addtex
Browse files Browse the repository at this point in the history
  • Loading branch information
zivyangll committed Jan 29, 2019
1 parent c1d2b82 commit 898a653
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3870,12 +3870,12 @@ function transferCode(data) {
.replace(/\)\./g, '\)\n\.');
}

function transferTest(test, suite) {
function transferTest(test, suite, parentTitle) {
const code = test.fn ? test.fn.toString() : test.body;

const cleaned = {
title: test.title,
fullTitle: suite.title + '--' + test.title,
fullTitle: parentTitle + ' -- ' + suite.title + ' -- ' + test.title,
duration: test.duration || 0,
state: test.state,
pass: test.state === 'passed',
Expand All @@ -3890,9 +3890,9 @@ function transferTest(test, suite) {
return cleaned;
}

function transferSuite(suite, totalTests, totalTime) {
function transferSuite(suite, totalTests, totalTime, parentTitle) {
suite.uuid = uuid();
let cleanTmpTests = suite.tests.map(test => test.state && transferTest(test, suite));
let cleanTmpTests = suite.tests.map(test => test.state && transferTest(test, suite, parentTitle));
let cleanTests = cleanTmpTests.filter(test => !!test);

const passingTests = cleanTests.filter(item => item.state === 'passed');
Expand Down Expand Up @@ -3938,7 +3938,7 @@ function getSuite(suite, totalTests) {

if (next.suites && next.suites.length) {
next.suites.forEach(nextSuite => {
transferSuite(nextSuite, totalTests, totalTime);
transferSuite(nextSuite, totalTests, totalTime, next.title);
queue.push(nextSuite);
});
}
Expand Down

0 comments on commit 898a653

Please sign in to comment.