feat(tests): add basic arithmetic functions and corresponding tests
- Implemented `add` and `subtract` functions in multiple packages (web, ui, utils). - Created unit tests for these functions using Vitest in respective test files. - Updated turbo.json to include a new test pipeline for coverage and watch mode.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export const add = (a: number, b: number) => a + b;
|
||||
@@ -0,0 +1 @@
|
||||
export const subtract = (a: number, b: number) => a - b;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { expect, test } from 'vitest';
|
||||
import { add } from './add';
|
||||
import { subtract } from './subtract';
|
||||
|
||||
test('adds 1 + 2 to equal 3', () => {
|
||||
expect(add(1, 2)).toBe(3);
|
||||
});
|
||||
|
||||
test('subtracts 2 - 1 to equal 1', () => {
|
||||
expect(subtract(2, 1)).toBe(1);
|
||||
});
|
||||
Reference in New Issue
Block a user