[英]Inspect a Method Chain with a Degugger in Node.js
我正在嘗試調試這種事情:
browser
.chain
.session()
.open('/')
.type('q', 'Hello World')
.click('btnG')
.waitForTextPresent('Hello World')
.getTitle(function(title){
assert.ok(~title.indexOf('hello world'), 'Title did not include the query: ' + title);
})
.click('link=Advanced search')
.waitForPageToLoad(2000)
.assertText('css=#gen-query', 'Hello World')
.assertAttribute('as_q@value', 'Hello World')
.end(function(err){
browser.testComplete(function(){
console.log('done');
if (err) throw err;
});
});
我已經設法使用直接node debug app.js
或使用node-inspector
和chrome
來連接調試器。 但是,當我嘗試在.click('btnG')
創建一個斷點時,它不起作用,它只在鏈的末尾創建一個斷點。 node.js
似乎將整個鏈視為單個語句。
你如何逐步調試這種鏈接? 你怎么能在這里注入一個REPL? 謝謝!
嘗試使用underscore.js中的tap方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.