Skip to content

Commit 1b4aebd

Browse files
authored
Update ConvertBase.test.js
1 parent ef4e3b4 commit 1b4aebd

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

Conversions/test/ConvertBase.test.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
import {
2-
convertBase
3-
} from '../ConvertBase'
1+
import {convertBase} from '../ConvertBase'
42

53
test('Converting number 10010 from base 4 to base 10 should be 260', () => {
6-
const res = convertBase(10010, 4, 10)
7-
expect(res).toBe(260)
4+
const res = convertBase(10010, 4, 10)
5+
expect(res).toBe(260)
86
})
97

108
test('Converting number 1101 from base 2 to base 10 should be 13', () => {
11-
const res = convertBase(1101, 2, 10)
12-
expect(res).toBe(13)
9+
const res = convertBase(1101, 2, 10)
10+
expect(res).toBe(13)
1311
})
1412

1513
test('Converting number 213 from base 5 to base 8 should be 53', () => {
16-
const res = convertBase(213, 5, 8)
17-
expect(res).toBe(72)
14+
const res = convertBase(213, 5, 8)
15+
expect(res).toBe(72)
1816
})
1917

2018
test('Converting number 37 from base 8 to base 3 should be 2111', () => {
21-
const res = convertBase(37, 8, 3)
22-
expect(res).toBe(1011)
19+
const res = convertBase(37, 8, 3)
20+
expect(res).toBe(1011)
2321
})
2422

2523
test('Converting number 123 from base 6 to base 4 should be 33', () => {
26-
const res = convertBase(123, 6, 4)
27-
expect(res).toBe(303)
24+
const res = convertBase(123, 6, 4)
25+
expect(res).toBe(303)
2826
})
2927

3028
test('Converting number 1010 from base 2 to base 9 should be 74', () => {
31-
const res = convertBase(1010, 2, 9)
32-
expect(res).toBe(11)
29+
const res = convertBase(1010, 2, 9)
30+
expect(res).toBe(11)
3331
})
3432

3533
test('Converting number 731 from base 7 to base 5 should be 2121', () => {
36-
const res = convertBase(731, 7, 5)
37-
expect(res).toBe(2430)
34+
const res = convertBase(731, 7, 5)
35+
expect(res).toBe(2430)
3836
})
3937

4038
test('Converting number 345 from base 9 to base 10 should be 344', () => {
41-
const res = convertBase(345, 9, 10)
42-
expect(res).toBe(284)
39+
const res = convertBase(345, 9, 10)
40+
expect(res).toBe(284)
4341
})

0 commit comments

Comments
 (0)