This commit is contained in:
OMGiTzPomPom 2024-03-29 11:13:21 +01:00
parent c58e016374
commit 62b7182133
6 changed files with 64 additions and 5269 deletions

7
.gitignore vendored
View File

@ -1,2 +1,7 @@
.DS_Store
node_modules
node_modules
package-lock.json
.idea/inspectionProfiles/
.idea/

5268
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
import {divide} from "./index";
describe("Test multiply", () => {
it.each([
{ a: 2, b : 1, expected: 2 },
])(
"should return multiplication of A by B",
({ a, b, expected }) => {
// arrange
// act
const result = divide(a,b);
// assert
expect(result).toEqual(expected);
}
);
});

View File

@ -0,0 +1,13 @@
async function start() {
console.log("Application starts...");
console.log("Application ends...");
}
start();
export function divide (a : number, b : number) : number {
if (b === 0) {
throw new Error('Division by zero');
}
return a/b;
}

View File

@ -0,0 +1,17 @@
import {multiply} from "./index";
describe("Test multiply", () => {
it.each([
{ a: 1, b : 2, expected: 2 },
])(
"should return multiplication of A by B",
({ a, b, expected }) => {
// arrange
// act
const result = multiply(a,b);
// assert
expect(result).toEqual(expected);
}
);
});

View File

@ -0,0 +1,11 @@
async function start() {
console.log("Application starts...");
console.log("Application ends...");
}
start();
export function multiply (a : number, b : number) : number {
return a*b;
}