template
This commit is contained in:
parent
9babbf846c
commit
97522013f3
32
src/exercises/Template/index.test.ts
Normal file
32
src/exercises/Template/index.test.ts
Normal 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);
|
||||
});
|
||||
});
|
10
src/exercises/Template/index.ts
Normal file
10
src/exercises/Template/index.ts
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user