feat: add simple test file and script
This commit is contained in:
12
src/test.ts
Normal file
12
src/test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
import assert from 'assert';
|
||||
|
||||
function add(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
assert.strictEqual(add(1, 2), 3, 'add(1, 2) should be 3');
|
||||
assert.strictEqual(add(0, 0), 0, 'add(0, 0) should be 0');
|
||||
assert.strictEqual(add(-1, 1), 0, 'add(-1, 1) should be 0');
|
||||
|
||||
console.log('All tests passed!');
|
||||
Reference in New Issue
Block a user