no-unused-expressions

This commit is contained in:
Alexander T
2019-06-19 17:01:53 +03:00
parent fdfff3593e
commit 5902b327db
8 changed files with 31 additions and 20 deletions

View File

@@ -125,7 +125,10 @@ namespace Harness.Parallel.Worker {
}
function addTest(title: string | Mocha.Func | Mocha.AsyncFunc, fn: Mocha.Func | Mocha.AsyncFunc | undefined): Mocha.Test {
if (typeof title === "function") fn = title, title = fn.name;
if (typeof title === "function") {
fn = title;
title = fn.name;
}
const test = new Test(title, suites[0].pending ? undefined : fn);
suites[0].addTest(test);
return test;
@@ -297,4 +300,4 @@ namespace Harness.Parallel.Worker {
process.on("message", processHostMessage);
}
}
}