|
1 | 1 | var r1 = require('../roundOne');
|
2 | 2 |
|
3 |
| -test('moves all zeroes in an array to the beginning', function() { |
4 |
| - var expected = [1, 2, 0, 0]; |
5 |
| - var actual = r1.leadZeroes(expected); |
6 |
| - expect(expected).toBe(actual); |
7 |
| - expect(r1.leadZeroes(expected)).toEqual(actual) |
| 3 | +describe('leadZeroes()', function() { |
| 4 | + test('moves all zeroes in an array to the beginning', function() { |
| 5 | + var expected = [1, 2, 0, 0]; |
| 6 | + var actual = r1.leadZeroes(expected); |
| 7 | + expect(expected).toBe(actual); |
| 8 | + expect(r1.leadZeroes(expected)).toEqual(actual) |
| 9 | + }); |
8 | 10 | });
|
9 | 11 |
|
10 | 12 | describe('setter()', function() {
|
@@ -59,10 +61,14 @@ describe('nextFive()', function() {
|
59 | 61 | })
|
60 | 62 | });
|
61 | 63 |
|
| 64 | +describe('osort()', function() { |
| 65 | + test('sorts an object alphabetically 1', function() { |
| 66 | + expect(r1.osort({z: 3, a: 1})).toEqual({a: 1, z: 3}); |
| 67 | + }); |
| 68 | + test('sorts object alphabetically 2', function() { |
| 69 | + expect(r1.osort({marketing: true, email: false, phone: false})).toEqual({email: false, marketing: true, phone: false}) |
| 70 | + }) |
| 71 | +}) |
62 | 72 |
|
63 | 73 |
|
64 |
| -test('sorts an object alphabetically', function() { |
65 |
| - expect(r1.osort({z: 3, a: 1})).toEqual({a: 1, z: 3}); |
66 |
| - expect(r1.osort({marketing: true, email: false, phone: false})).toEqual({email: false, marketing: true, phone: false}) |
67 |
| -}); |
68 | 74 |
|
0 commit comments