Skip to content

Instantly share code, notes, and snippets.

View Itsindigo's full-sized avatar
🐐

Matthew Bridges Itsindigo

🐐
View GitHub Profile
@Itsindigo
Itsindigo / transformText.test.ts
Last active November 25, 2024 18:45
Text transformer
import { expect, test, describe } from "vitest";
import { transformText } from "./transformText";
describe("transformText", () => {
test("should handle replacement commands across a word", () => {
expect(transformText("Hello World", "rhllllllrw")).toEqual("hello world");
});
test("handle multiple replace", () => {
expect(transformText("xxx", "3rY")).toEqual("YYY");