【发布时间】:2023-03-24 10:14:02
【问题描述】:
在下面的代码中,我可以使用then 而不是andThen,我看到一切运行良好。那么,是什么让 andThen 如此特别?
test('Clicked on the About page /about', function(assert) {
visit('/')
.click('a:contains("About")')
.then(function(){
assert.equal(currentURL(), '/about', 'SHould Navigate to about')
})
});
test('Clicked on the About page /about', function(assert) {
visit('/')
.click('a:contains("About")')
.andThen(function(){
assert.equal(currentURL(), '/about', 'SHould Navigate to about')
})
});
【问题讨论】:
标签: javascript ember.js promise