[ospec] cleanup o.only

This commit is contained in:
Pierre-Yves Gérardy 2018-05-26 00:48:44 +02:00 committed by Pierre-Yves Gérardy
parent f6e23da56c
commit e473536866

View file

@ -32,12 +32,11 @@ else window.o = m()
ctx = parent ctx = parent
} }
o.only = function(subject, predicate, silent) { o.only = function(subject, predicate, silent) {
if (!silent) { if (!silent) console.log(
console.log(highlight("/!\\ WARNING /!\\ o.only() mode")) highlight("/!\\ WARNING /!\\ o.only() mode") + "\n" + o.cleanStackTrace(ensureStackTrace(new Error)) + "\n",
try {throw new Error} catch (e) { cStyle("red"), ""
console.log(o.cleanStackTrace(e) + "\n") )
}
}
o(subject, only = predicate) o(subject, only = predicate)
} }
o.spy = function(fn) { o.spy = function(fn) {