test: added supertest
This commit is contained in:
9
src/utils/addition.test.ts
Normal file
9
src/utils/addition.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { addition } from './addition';
|
||||
|
||||
describe('call', () => {
|
||||
it('returns the input value increased by one', async () => {
|
||||
const response = addition(3);
|
||||
|
||||
expect(response).toBe(4);
|
||||
});
|
||||
});
|
||||
8
src/utils/addition.ts
Normal file
8
src/utils/addition.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Format a response message containing a user input.
|
||||
* @param number - The user input value.
|
||||
* @returns The value increased by one.
|
||||
*/
|
||||
export function addition(value: number) {
|
||||
return value + 1;
|
||||
}
|
||||
Reference in New Issue
Block a user