We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b097083 commit 5465151Copy full SHA for 5465151
Roadmap/13 - PRUEBAS UNITARIAS/typescript/qwik-zgheib.ts
@@ -0,0 +1,21 @@
1
+import assert from "assert";
2
+
3
+export const sum = (a: number, b: number): number => a + b;
4
5
+function test(description: string, fn: () => void): void {
6
+ try {
7
+ fn();
8
+ console.log(`✔️ ${description}`);
9
+ } catch (error) {
10
+ console.log(`❌ ${description}`);
11
+ console.error(error);
12
+ }
13
+}
14
15
+test("adds 1 + 2 to equal 3", () => {
16
+ assert.strictEqual(sum(1, 2), 3);
17
+});
18
19
+test("adds 1 + 1 to equal 2", () => {
20
+ assert.strictEqual(sum(1, 1), 2);
21
0 commit comments