Skip to content

Commit

Permalink
test: make test command aggregation more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst authored and daprahamian committed Aug 13, 2019
1 parent 51a36f3 commit affc92b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/functional/runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,13 @@ function isTestRunnerCommand(context, commandName) {

let methods = new Set();
let object = testRunnerContext;
do {
if (object === Object.prototype) {
break;
}

while (object !== Object.prototype) {
Object.getOwnPropertyNames(object)
.filter(prop => typeof object[prop] === 'function' && prop !== 'constructor')
.map(prop => methods.add(prop));
} while ((object = Object.getPrototypeOf(object)));

object = Object.getPrototypeOf(object);
}

return methods.has(commandName);
}
Expand Down

0 comments on commit affc92b

Please sign in to comment.