summary refs log tree commit diff stats
path: root/javascript/square-root/square-root.spec.js
blob: 3db6fcbb27e5902de92859715bdb37aef19f64cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
    });
});