Skip to content

Instantly share code, notes, and snippets.

@qunabu
Created November 26, 2020 10:27
Show Gist options
  • Save qunabu/38ab02e99769d23ecdd3b161ad532eba to your computer and use it in GitHub Desktop.
Save qunabu/38ab02e99769d23ecdd3b161ad532eba 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