我想知道是否有任何方法可以从内部主题的测试中获取外部主题的返回值。如果这令人困惑,这里有一个例子:
"build.css" : {
topic : function(file) {
fs.readFile(fixtures + "/public/build.css", "utf8", this.callback);
},
'exists' : function(err, build) {
assert.isNull(err); // This is fine..
},
{
'should contain' : {
topic : function() {
return "wahoo";
},
'some cool css' : function(wahooString, err, build) {
// Where did build go? Can I still access it from this scope?
}
...
}
...