summary refs log tree commit diff stats
path: root/javascript/square-root/square-root.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/square-root/square-root.spec.js')
-rw-r--r--javascript/square-root/square-root.spec.js22
1 files changed, 22 insertions, 0 deletions
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);
+    });
+});