Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(test): check setImmediate supports
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion authored and mhevery committed Apr 1, 2018
1 parent ac4ceb3 commit 6c7e45b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/zone-spec/fake-async-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('FakeAsyncTestZoneSpec', () => {
});
});

it('should run queued immediate timer on zero tick', () => {
it('should run queued immediate timer on zero tick', ifEnvSupports('setImmediate', () => {
fakeAsyncTestZone.run(() => {
let ran = false;
setImmediate(() => {
Expand All @@ -148,7 +148,7 @@ describe('FakeAsyncTestZoneSpec', () => {
testZoneSpec.tick();
expect(ran).toEqual(true);
});
});
}));

it('should run queued timer after sufficient clock ticks', () => {
fakeAsyncTestZone.run(() => {
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('FakeAsyncTestZoneSpec', () => {
});
});

it('should pass arguments to setImmediate', () => {
it('should pass arguments to setImmediate', ifEnvSupports('setImmediate', () => {
fakeAsyncTestZone.run(() => {
let value = 'genuine value';
let id = setImmediate((arg1, arg2) => {
Expand All @@ -242,7 +242,7 @@ describe('FakeAsyncTestZoneSpec', () => {
testZoneSpec.tick();
expect(value).toEqual('expected value');
});
});
}));

it('should run periodic timers', () => {
fakeAsyncTestZone.run(() => {
Expand Down

0 comments on commit 6c7e45b

Please sign in to comment.