pig-dam-core
Version:
Library that should be included in every Pig DAM project we build
30 lines (29 loc) • 772 B
JavaScript
;
/**
* Date: 5/22/20
* Time: 8:58 PM
* @license MIT (see project's LICENSE file)
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterTestDescriptions = void 0;
/**
* Filters test descriptions that support the `TestDescription` interface
*/
function filterTestDescriptions(suite) {
const filtered = {
enabled: [],
exclusive: []
};
suite.forEach(test => {
if (!test.disabled) {
filtered.enabled.push(test);
if (test.exclusive) {
filtered.exclusive.push(test);
}
}
});
return (filtered.exclusive.length > 0)
? filtered.exclusive
: filtered.enabled;
}
exports.filterTestDescriptions = filterTestDescriptions;