Skip to content

Commit

Permalink
add helloWorld
Browse files Browse the repository at this point in the history
  • Loading branch information
s1adem4n committed Jul 30, 2023
1 parent 4ca0539 commit a79a2e6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/helloWorld.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { describe, expect, it, vi } from "vitest";

import { helloWorld } from "./helloWorld.js";

describe("helloWorld", () => {
it("logs 'Hello World!' to the console", () => {
const logger = vi.spyOn(console, "log").mockImplementation(() => undefined);

helloWorld();

expect(logger).toHaveBeenCalledWith("Hello World!");
expect(logger).toHaveBeenCalledTimes(1);
});
});
3 changes: 3 additions & 0 deletions src/helloWorld.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function helloWorld() {
console.log("Hello World!");
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./greet.js";
export * from "./helloWorld.js";
export * from "./types.js";

0 comments on commit a79a2e6

Please sign in to comment.