-
-
Save machty/574457b1f2d993cc5959a1d6d6c74e5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Component.extend({ | |
fooValue: 0, | |
looper: task(function * () { | |
while(true) { | |
yield timeout(500, "x-foo#looper-tick"); | |
this.incrementProperty('fooValue'); | |
} | |
}).on('init') | |
}) | |
test('x-foo', function(assert) => { | |
visit('/'); | |
return waitForTimer("x-foo#looper-tick").then((timer) => { | |
assert.equal(find('.fooValue').text(), 0); | |
return timer.fire(); | |
}).then(() => { | |
assert.equal(find('.fooValue').text(), 1); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding to the thread. the following worked for me. Caveat: I used sinon.useFakeTimers during unit/integration testing and left as is during acceptance tests.