mirror of
https://github.com/hanzoai/Detox.git
synced 2026-10-30 14:46:00 +00:00
16 lines
357 B
JavaScript
16 lines
357 B
JavaScript
const _ = require('lodash');
|
|
|
|
function hasTimedOut(test) {
|
|
const { errors } = test;
|
|
const errorsArray = (_.isArray(errors) ? errors : [errors]);
|
|
const timedOut = _.chain(errorsArray)
|
|
.flattenDeep()
|
|
.filter(_.isObject)
|
|
.some(e => _.includes(e.message, 'Exceeded timeout'))
|
|
.value();
|
|
|
|
return timedOut;
|
|
}
|
|
|
|
module.exports = hasTimedOut;
|