此技术有效:
创建帮助函数以在隔离的范围内运行函数
const foo = 3; it.cb(isolated(h => { console.log(foo); // this will throw "ReferenceError: foo is not defined" h.ctn(); }));您可能还对Javascript
with运算符有些运气

此技术有效:
创建帮助函数以在隔离的范围内运行函数
const foo = 3; it.cb(isolated(h => { console.log(foo); // this will throw "ReferenceError: foo is not defined" h.ctn(); }));您可能还对Javascript
with运算符有些运气