mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-09 10:18:32 +01:00
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
21 lines
444 B
Diff
21 lines
444 B
Diff
diff --git a/test/add.test.ts b/test/add.test.ts
|
|
new file mode 100644
|
|
index 0000000..ac2562b
|
|
--- /dev/null
|
|
+++ b/test/add.test.ts
|
|
@@ -0,0 +1,14 @@
|
|
+import { test, expect } from 'bun:test';
|
|
+import { add } from '../src/add';
|
|
+
|
|
+test('adds two numbers', () => {
|
|
+ expect(add(1, 2)).toBe(3);
|
|
+});
|
|
+
|
|
+test('adds negatives', () => {
|
|
+ expect(add(-1, -2)).toBe(-3);
|
|
+});
|
|
+
|
|
+test('is commutative', () => {
|
|
+ expect(add(2, 3)).toBe(add(3, 2));
|
|
+});
|