Skip to content

Commit c4567a8

Browse files
committed
Remove nested describes to unbreak task-based testing
1 parent 3beab57 commit c4567a8

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed

exercises/concept/freelancer-rates/freelancer-rates.spec.js

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,57 +35,49 @@ describe('day rate', () => {
3535
});
3636

3737
describe('days in budget', () => {
38-
describe('with a budget of 1280', () => {
39-
test('at 16/hour', () => {
40-
const actual = daysInBudget(1280, 16);
41-
const expected = 10;
38+
test('with a budget of 1280 at 16/hour', () => {
39+
const actual = daysInBudget(1280, 16);
40+
const expected = 10;
4241

43-
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
44-
});
42+
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
43+
});
4544

46-
test('at 25/hour', () => {
47-
const actual = daysInBudget(1280, 25);
48-
const expected = 6;
45+
test('with a budget of 1280 at 25/hour', () => {
46+
const actual = daysInBudget(1280, 25);
47+
const expected = 6;
4948

50-
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
51-
});
49+
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
50+
});
5251

53-
describe('with a budget of 835', () => {
54-
test('at 12/hour', () => {
55-
const actual = daysInBudget(835, 12);
56-
const expected = 8;
52+
test('with a budget of 835 at 12/hour', () => {
53+
const actual = daysInBudget(835, 12);
54+
const expected = 8;
5755

58-
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
59-
});
60-
});
56+
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
6157
});
6258
});
6359

6460
describe('cost with monthly discount', () => {
65-
describe('at 16/hour', () => {
66-
test('for 70 days', () => {
61+
test('at 16/hour for 70 days', () => {
6762
const actual = priceWithMonthlyDiscount(16, 70, 0);
6863
const expected = 8960;
6964
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
7065
});
7166

72-
test('for 130 days with 15% discount', () => {
67+
test('at 16/hour for 130 days with 15% discount', () => {
7368
const actual = priceWithMonthlyDiscount(16, 130, 0.15);
7469
const expected = 14528;
7570
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
7671
});
72+
test('at 29.654321/hour for 220 days with 11.2%', () => {
73+
const actual = priceWithMonthlyDiscount(29.654321, 220, 0.112);
74+
const expected = 46347;
75+
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
7776
});
78-
describe('at 29.654321/hour', () => {
79-
test('for 220 days with 11.2%', () => {
80-
const actual = priceWithMonthlyDiscount(29.654321, 220, 0.112);
81-
const expected = 46347;
82-
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
83-
});
8477

85-
test('for 155 days with 25.47% discount', () => {
86-
const actual = priceWithMonthlyDiscount(29.654321, 155, 0.2547);
87-
const expected = 27467;
88-
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
89-
});
78+
test('at 29.654321/hour for 155 days with 25.47% discount', () => {
79+
const actual = priceWithMonthlyDiscount(29.654321, 155, 0.2547);
80+
const expected = 27467;
81+
expect(actual).toBeCloseTo(expected, DIFFERENCE_PRECISION_IN_DIGITS);
9082
});
9183
});

0 commit comments

Comments
 (0)