From 8b8a3c7f2345508147a0d07ba6e2e80dd86b1883 Mon Sep 17 00:00:00 2001 From: Carlos Santiago <5726971+csantiago132@users.noreply.github.com> Date: Sun, 8 Dec 2024 23:56:34 -0600 Subject: [PATCH] chore(config): adds example test --- app/sum.test.ts | 11 +++++++++++ package.json | 3 ++- pnpm-lock.yaml | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/sum.test.ts diff --git a/app/sum.test.ts b/app/sum.test.ts new file mode 100644 index 0000000..6c87123 --- /dev/null +++ b/app/sum.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from 'vitest'; + +function sum(a: number, b: number): number { + return a + b; +} + +describe('sum function', () => { + it('should add two numbers correctly', () => { + expect(sum(1, 2)).toBe(3); + }); +}); diff --git a/package.json b/package.json index 332e90e..b8d2636 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "semantic-release": "^23.0.2", "typescript": "^5.4.2", "vite": "^5.1.0", - "vite-tsconfig-paths": "^4.2.1" + "vite-tsconfig-paths": "^4.2.1", + "vitest": "^2.1.8" }, "engines": { "node": ">=20" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b304272..454d011 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,6 +87,9 @@ importers: vite-tsconfig-paths: specifier: ^4.2.1 version: 4.3.2(typescript@5.7.2)(vite@5.4.11(@types/node@20.5.0)) + vitest: + specifier: ^2.1.8 + version: 2.1.8(@types/node@20.5.0)(jsdom@25.0.1) packages: