/
BGVal
/
basic-js
Обзор
Документация
Войти
/
BGVal
/
basic-js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
extensions/it-optional.js
30 строк
706 B
AlreadyBored
fix: fix hanoi-tower test issue with precision + fix it-optional implementation + minor fixes to descriptions
01 май 2020, 17:21
01 май 2020, 17:21
c21d85e
Код
Авторство
О чём код?
// code is based on solution from https://github.com/mikhama/core-js-101 function testOptional(title, fn, isAsyncTest) { if (isAsyncTest) { it(title, function test(done) { try { fn.call(this, done); } catch (err) { if (err._validationProp === 'NA') { this.test.skip(); } else { throw err; } } }); } else { it(title, function test() { try { fn.call(this); } catch (err) { if (err._validationProp === 'NA') { this.test.skip(); } else { throw err; } } }); } } module.exports = testOptional;