Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions lib/fivemat_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,20 @@ function FivematProgress(runner, options) {

completedTotal += complete;
complete = 0;
// current project test count is 3372 but only 12 suites due to dynamic test creation
// total hack here to just call the total count ~ real total with headroom
total = newTitle === 'Projects tests' ? 3500 : suite.total();
if (newTitle === 'Projects tests') {
// we have to compute how many projects tests from looking into how many files in the directory
// suite.total() only shows test suite per test-files
// Get the top level directory, the root of the TypeScript repository
var topLevelDirectory = __dirname.substring(0, __dirname.indexOf("node_modules"));
var projectDirectory = path.join(topLevelDirectory, path.normalize("tests/cases/project"));
var projectFiles = fs.readdirSync(projectDirectory);
// Get the number of project testcases then we multiply by the amount of suite each will be run
total = projectFiles.length * suite.total();
}
else {
total = suite.total();
}

lastN = -1;

pass = 0;
Expand Down Expand Up @@ -120,7 +131,7 @@ function FivematProgress(runner, options) {
process.stdout.write('\u001b[J');
process.stdout.write(color('progress', ' ' + options.open));
process.stdout.write(color(fail > 0 ? 'fail' : 'pending', Array(n).join(options.complete)));
process.stdout.write(Array(i).join(options.incomplete));
process.stdout.write(Array(i >= 0 ? i : 0).join(options.incomplete));
process.stdout.write(color('progress', options.close));
if (options.verbose) {
process.stdout.write(color('progress', ' ' + complete + ' of ' + total));
Expand Down