From 3fb698bbe091cbaa8d5d3f2256ebfb776523448d Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 25 Aug 2021 20:10:19 +0530 Subject: JS: Solve hello-world, two-fer, square-root --- javascript/square-root/square-root.spec.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 javascript/square-root/square-root.spec.js (limited to 'javascript/square-root/square-root.spec.js') diff --git a/javascript/square-root/square-root.spec.js b/javascript/square-root/square-root.spec.js new file mode 100644 index 0000000..3db6fcb --- /dev/null +++ b/javascript/square-root/square-root.spec.js @@ -0,0 +1,22 @@ +import { squareRoot } from './square-root'; + +describe('Square root', () => { + test('root of 1', () => { + expect(squareRoot(1)).toEqual(1); + }); + test('root of 4', () => { + expect(squareRoot(4)).toEqual(2); + }); + test('root of 5', () => { + expect(squareRoot(25)).toEqual(5); + }); + test('root of 81', () => { + expect(squareRoot(81)).toEqual(9); + }); + test('root of 196', () => { + expect(squareRoot(196)).toEqual(14); + }); + test('root of 65025', () => { + expect(squareRoot(65025)).toEqual(255); + }); +}); -- cgit 1.4.1-2-gfad0