Hello World
2025-03-30
typescript
testing
Placeholder for a blog post
with a code block.
function hello<const T extends string>(greeting: T = "world") {
console.log(`Hello, ${greeting}!`);
}
hello("John Snow");
if (import.meta.vitest) {
const { test, expect } = import.meta.vitest;
test("hello", () => {
expect(hello()).toBe("Hello, world!");
});
test("hello with argument", () => {
expect(hello("John Snow")).toBe("Hello, John Snow!");
});
}