-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec.js
77 lines (62 loc) · 1.72 KB
/
spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const {
mult3And5,
fibonacci,
largePrimeFactor,
largePalidrome,
smallMult
} = require('./solutions');
describe('Tests for mult3And5', () => {
test('mult3And5 is a function', () => {
expect(typeof mult3And5).toEqual('function');
});
test('outputs a number', () => {
expect(typeof mult3And5(1000)).toBe('number');
});
test('sums multiples of 3 and 5', () => {
expect(mult3And5(10)).toEqual(23);
});
});
describe('Tests for fibonacci', () => {
test('fibonacci is a function', () => {
expect(typeof fibonacci).toEqual('function');
});
test('outputs a number', () => {
expect(typeof fibonacci(100)).toBe('number');
});
test('outputs sum of first 5 even fibonacci numbers', () => {
expect(fibonacci(5)).toEqual(10);
});
});
describe('Tests for largePrimeFactor', () => {
test('largePrimeFactor is a function', () => {
expect(typeof largePrimeFactor).toEqual('function');
});
test('outputs a number', () => {
expect(typeof largePrimeFactor(1000)).toBe('number');
});
test('outputs largest prime factor', () => {
expect(largePrimeFactor(13195)).toEqual(29);
});
});
describe('Tests for largePalidrome', () => {
test('largePalidrome is a function', () => {
expect(typeof largePalidrome).toEqual('function');
});
test('outputs a number', () => {
expect(typeof largePalidrome(99, 99)).toBe('number');
});
test('outputs largest palidrome', () => {
expect(largePalidrome(99, 99)).toEqual(9009);
});
});
describe('Tests for smallMult', () => {
test('smallMult is a function', () => {
expect(typeof largePalidrome).toEqual('function');
});
test('outputs a number', () => {
expect(typeof smallMult(10)).toBe('number');
});
test('outputs smallMult', () => {
expect(smallMult(10)).toEqual(2520);
});
});