Skip to content

Instantly share code, notes, and snippets.

@qunabu
Created November 26, 2020 10:26
Show Gist options
  • Save qunabu/9d1ea87e6cd7217753119e9e4444f971 to your computer and use it in GitHub Desktop.
Save qunabu/9d1ea87e6cd7217753119e9e4444f971 to your computer and use it in GitHub Desktop.
it("should properly sanitize strings", () => {
expect(sanitizeString("Avi" + String.fromCharCode(243) + "n")).toBe("Avion");
expect(sanitizeString("The space")).toBe("The-space");
expect(sanitizeString("Weird chars!!")).toBe("Weird-chars-");
expect(sanitizeString("file name.zip")).toBe("file-name.zip");
expect(sanitizeString("my.name.zip")).toBe("my-name.zip");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment