-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Cleanup unit tests that wait for a promise #4638
Comments
And fwiw, even if we are inspecting the callback values, it can still be simplified: runs(function () {
var promise = asyncCall();
promise.done(function (result) {
expect(result.foo).toBe(bar);
});
waitsForDone(promise);
}); |
I would like to take this on. Before I start, is the only unit test suite that needs to be fixed |
I found this in CSS-Utils-test.js:
Is this the scenario you are talking about @jasonsanjose @peterflynn? |
@DaBungalow yes |
WorkingSetView-test.js has some too. Check @jasonsanjose comment here #4635. |
As I go through these tests, I am noticing some JSLint errors. Should I go ahead and fix them? Or is that best saved for another issue? |
There are no errors on any of the files in spec. Are you running with the JSLint module updated? There were a few JSLint error when we switched to a module, but those should be fixed after the module update. But, yes, fix any JSLint error you see, but make sure that the module is updated first. |
I apparently just got it updated because all errors disappeared after On 8/10/13, Tomás Malbrán notifications@github.com wrote:
Danny Seymour |
I thought so. When I switched JSLint to a submodule I got a older version by mistake. I thought it was ok until I started seeing more errors, so I made a PR to update it to the version that we had before, to fix those errors. |
Hi, Is there a PR for this issue or should I go ahead and start on this? |
Working on it. |
I'll refactor some tests! 👍 |
Hi, Is this available to work on? |
We have older async unit tests that follow this pattern when waiting for a promise
We can reduce this to...
...assuming that we're not inspecting the values from the
done
orfail
callbacks.The text was updated successfully, but these errors were encountered: