Skip to content

Commit 241c340

Browse files
committed
Simplify async tests
1 parent 08ff710 commit 241c340

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/ng/intervalSpec.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("$interval", () => {
2828
}, 1);
2929
expect(counter).toBe(0);
3030
await wait(15);
31-
expect(counter).toBeGreaterThanOrEqual(2);
31+
expect(counter).toBeGreaterThanOrEqual(1);
3232
});
3333

3434
it("should call $apply after each task is executed", (done) => {
@@ -138,13 +138,11 @@ describe("$interval", () => {
138138
);
139139
expect(log).toEqual([]);
140140

141-
await wait(2);
142-
expect(log).toEqual([
143-
"tick",
144-
"promise update: 0",
145-
"tick",
146-
"promise update: 1",
147-
]);
141+
await wait(5);
142+
expect(log[0]).toEqual( "tick");
143+
expect(log[1]).toEqual( "promise update: 0");
144+
expect(log[2]).toEqual( "tick");
145+
expect(log[3]).toEqual( "promise update: 1");
148146
});
149147

150148
it("should return a promise which will be resolved after the specified number of iterations", async () => {

0 commit comments

Comments
 (0)