Last active
December 26, 2015 19:39
-
-
Save laser/7202624 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// in the test code: | |
it("updates the page title on click", function() { | |
assert.equals(view.find("h1").text(), "before update"); | |
view.find("button").trigger("click"); // uh oh-async! | |
assert.equals(view.find("h1").text(), "after update"); // will fail due to callback being part of different stack | |
}); | |
// in the view itself: | |
button.onclick = function(e) { | |
setTimeout(function() { | |
header.innerHTML = "after update"; | |
}, 500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment