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

Commit 6c7e45b

Browse files
JiaLiPassionmhevery
authored andcommitted
fix(test): check setImmediate supports
1 parent ac4ceb3 commit 6c7e45b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: test/zone-spec/fake-async-test.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('FakeAsyncTestZoneSpec', () => {
136136
});
137137
});
138138

139-
it('should run queued immediate timer on zero tick', () => {
139+
it('should run queued immediate timer on zero tick', ifEnvSupports('setImmediate', () => {
140140
fakeAsyncTestZone.run(() => {
141141
let ran = false;
142142
setImmediate(() => {
@@ -148,7 +148,7 @@ describe('FakeAsyncTestZoneSpec', () => {
148148
testZoneSpec.tick();
149149
expect(ran).toEqual(true);
150150
});
151-
});
151+
}));
152152

153153
it('should run queued timer after sufficient clock ticks', () => {
154154
fakeAsyncTestZone.run(() => {
@@ -232,7 +232,7 @@ describe('FakeAsyncTestZoneSpec', () => {
232232
});
233233
});
234234

235-
it('should pass arguments to setImmediate', () => {
235+
it('should pass arguments to setImmediate', ifEnvSupports('setImmediate', () => {
236236
fakeAsyncTestZone.run(() => {
237237
let value = 'genuine value';
238238
let id = setImmediate((arg1, arg2) => {
@@ -242,7 +242,7 @@ describe('FakeAsyncTestZoneSpec', () => {
242242
testZoneSpec.tick();
243243
expect(value).toEqual('expected value');
244244
});
245-
});
245+
}));
246246

247247
it('should run periodic timers', () => {
248248
fakeAsyncTestZone.run(() => {

0 commit comments

Comments
 (0)