-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove custom storage option and interface
- Loading branch information
Showing
16 changed files
with
117 additions
and
225 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
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
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
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
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
20 changes: 14 additions & 6 deletions
20
packages/browser/src/core/storage/__tests__/test-helpers.ts
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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
import jar from 'js-cookie' | ||
/** | ||
* Disables Cookies | ||
* @returns jest spy | ||
*/ | ||
export function disableCookies(): jest.SpyInstance { | ||
return jest | ||
.spyOn(window.navigator, 'cookieEnabled', 'get') | ||
.mockReturnValue(false) | ||
export function disableCookies(): void { | ||
jest.spyOn(window.navigator, 'cookieEnabled', 'get').mockReturnValue(false) | ||
jest.spyOn(jar, 'set').mockImplementation(() => { | ||
throw new Error() | ||
}) | ||
jest.spyOn(jar, 'get').mockImplementation(() => { | ||
throw new Error() | ||
}) | ||
} | ||
|
||
/** | ||
* Disables LocalStorage | ||
* @returns jest spy | ||
*/ | ||
export function disableLocalStorage(): jest.SpyInstance { | ||
return jest.spyOn(Storage.prototype, 'setItem').mockImplementation(() => { | ||
export function disableLocalStorage(): void { | ||
jest.spyOn(Storage.prototype, 'setItem').mockImplementation(() => { | ||
throw new Error() | ||
}) | ||
jest.spyOn(Storage.prototype, 'getItem').mockImplementation(() => { | ||
throw new Error() | ||
}) | ||
} |
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
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
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
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
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
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
Oops, something went wrong.