self.getDocumentCount().then(function (text) {
var stringArray = text.split("(");
count = stringArray[0].trim();
}).then(function () {
self.logger.info("Document text : " + count, self);
});
self.logger.info("Checking the count again : " + count, self);
我无法获得超出承诺的价值。即代码片段中的最后一个计数变量
我正在使用量角器+ javascript + jasmine
答案 0 :(得分:-1)
你试过这个吗?
var tempObject = {}
it('should get count', function() {
getDocumentCount(strDoc);
});
it('should display count', function() {
console.log(tempObject.Count);
});
function = getDocumentCount(text) {
var stringArray = text.split("(");
tempObject.Count = stringArray[0].trim();
})