∞
Converging on a Condition in QUnit
While writing some acceptance tests recently I kept running into slight race conditions between the state my application and an assertion I wanted to make. For example, one of the tests looked something like this:
test("creating a comment", async function (assert) { assert.equal(Task.comments.messages.length, 5, "Starts with correct number of comments"); await Task.comments.input.fillIn("A new comment"); await Task.comments.send(); assert.equal(Task.comments.message.length, 6, "Adds a new comment"); }); How does the test know that the right number of messages should be visible at the point that send() resolves?
∞
Observables: A Brief Introduction
Lately I’ve been thinking a lot about “pull” and “push” with regard to the way functions interact with each other. Imagine two functions, a and b, where a depends on receiving a value from b. The value is pulled if a determines when the value is delivered; it is pushed if b determines the timing.
Combined with the ability to produce either one or more than one value, you get a total of four possible categories: