-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: empty string no longer coalesces into null (#121)
* fix: empty string no longer coalesces into null * fix: empty string no longer coalesces into null Co-authored-by: Zachary Mayry <[email protected]> Co-authored-by: Bryan Clark <[email protected]>
1 parent
e70a179
commit 9bcc9b3
Showing
2 changed files
with
21 additions
and
1 deletion.
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,20 @@ | ||
import { LocalStorage } from "../src/localstorage"; | ||
|
||
describe("localstorage", () => { | ||
let localStorage; | ||
|
||
beforeEach(() => { | ||
localStorage = new LocalStorage(jest); | ||
}); | ||
|
||
describe("getItem", () => { | ||
it("should return null if the item is undefined", () => { | ||
expect(localStorage.getItem("item")).toBeNull(); | ||
}); | ||
|
||
it("should return '' instead of null", () => { | ||
localStorage.setItem("item", ""); | ||
expect(localStorage.getItem("item")).toBe(""); | ||
}); | ||
}); | ||
}); |
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