Skip to content

Instantly share code, notes, and snippets.

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