-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
df8af66
commit 839a34c
Showing
6 changed files
with
54 additions
and
52 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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { escapeString } from "./script"; | ||
|
||
describe('escapeString', () => { | ||
it('handles the empty string', () => { | ||
expect(escapeString('')).toBe(''); | ||
describe("escapeString", () => { | ||
it("handles the empty string", () => { | ||
expect(escapeString("")).toBe(""); | ||
}); | ||
it('handles a normal string', () => { | ||
expect(escapeString('A landslide has occurred!')).toBe('A landslide has occurred!'); | ||
it("handles a normal string", () => { | ||
expect(escapeString("A landslide has occurred!")).toBe( | ||
"A landslide has occurred!", | ||
); | ||
}); | ||
it('escapes quotes', () => { | ||
expect(escapeString('An "Energy Crystal" has been found!')).toBe('An \\"Energy Crystal\\" has been found!'); | ||
it("escapes quotes", () => { | ||
expect(escapeString('An "Energy Crystal" has been found!')).toBe( | ||
'An \\"Energy Crystal\\" has been found!', | ||
); | ||
}); | ||
it('removes backslashes', () => { | ||
expect(escapeString('\\n\\n\\n\\')).toBe('nnn'); | ||
it("removes backslashes", () => { | ||
expect(escapeString("\\n\\n\\n\\")).toBe("nnn"); | ||
}); | ||
}); | ||
}); |
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