This commit is contained in:
OMGiTzPomPom 2024-03-29 12:01:00 +01:00
parent 9babbf846c
commit 97522013f3
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import { divide } from "./index";
describe("Test divide", () => {
it.each([
{ foo: "", bar: "", expected: "" },
])(
"should $foo $bar",
({ foo, bar, expected }) => {
// act
// const result = function (foo, bar);
const result = 0;
// assert
expect(result).toEqual(expected);
console.log(`Test with foo = ${foo}, bar = ${bar}, expected = ${expected}, result = ${result}`);
}
);
/*
*
* If exception test
*
* */
it("should throw an exception when dividing by zero", () => {
// arrange
const foo = "";
const bar = "";
// act & assert
///TODO
// expect(() => function (foo, bar).toThrow("E");
console.log(foo + bar);
});
});

View File

@ -0,0 +1,10 @@
async function start() {
console.log("Application starts...");
console.log("Application ends...");
}
start();
export function name(foo : number) : number {
return foo + 1;
}