-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import isProxySupported from 'isProxySupported'; | ||
|
||
describe('isProxySupported', () => { | ||
describe('When proxy is supported', () => { | ||
it('should return true', () => { | ||
expect(isProxySupported()).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('When proxy is not supported', () => { | ||
describe('When Proxy is undefined', () => { | ||
beforeEach(() => { | ||
Object.defineProperty(global, 'Proxy', { | ||
value: undefined, | ||
configurable: true, | ||
}); | ||
}); | ||
|
||
it('should return false', () => { | ||
expect(isProxySupported()).toBe(false); | ||
}); | ||
}); | ||
|
||
describe('When proxy property does not exist on global object', () => { | ||
beforeEach(() => { | ||
// @ts-ignore | ||
delete global.Proxy; | ||
}); | ||
|
||
it('should return false', () => { | ||
expect(isProxySupported()).toBe(false); | ||
}); | ||
}); | ||
}); | ||
}); |