Skip to content

Commit 0065cb1

Browse files
committed
[Tests] use proper actual, expected ordering for non-confusing failure messages
1 parent 805b86b commit 0065cb1

9 files changed

+316
-316
lines changed

__tests__/src/elementType-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('elementType tests', () => {
1111
const expected = 'function';
1212
const actual = typeof elementType;
1313

14-
assert.equal(expected, actual);
14+
assert.equal(actual, expected);
1515
});
1616

1717
it('should throw an error if the argument is missing', () => {
@@ -29,7 +29,7 @@ describe('elementType tests', () => {
2929
const expected = 'div';
3030
const actual = elementType(node);
3131

32-
assert.equal(expected, actual);
32+
assert.equal(actual, expected);
3333
});
3434

3535
it('should return the correct type of the custom element given its node object', () => {
@@ -39,7 +39,7 @@ describe('elementType tests', () => {
3939
const expected = 'Slider';
4040
const actual = elementType(node);
4141

42-
assert.equal(expected, actual);
42+
assert.equal(actual, expected);
4343
});
4444

4545
it('should return the correct type of the custom object element given its node object', () => {
@@ -49,7 +49,7 @@ describe('elementType tests', () => {
4949
const expected = 'UX.Slider';
5050
const actual = elementType(node);
5151

52-
assert.equal(expected, actual);
52+
assert.equal(actual, expected);
5353
});
5454

5555
it('should return the correct type of the namespaced element given its node object', () => {
@@ -59,7 +59,7 @@ describe('elementType tests', () => {
5959
const expected = 'UX:Slider';
6060
const actual = elementType(node);
6161

62-
assert.equal(expected, actual);
62+
assert.equal(actual, expected);
6363
});
6464

6565
it('should return the correct type of the multiple custom object element given its node object',
@@ -70,7 +70,7 @@ describe('elementType tests', () => {
7070
const expected = 'UX.Slider.Blue.Light';
7171
const actual = elementType(node);
7272

73-
assert.equal(expected, actual);
73+
assert.equal(actual, expected);
7474
});
7575

7676
it('should return this.Component when given its node object', () => {
@@ -80,6 +80,6 @@ describe('elementType tests', () => {
8080
const expected = 'this.Component';
8181
const actual = elementType(node);
8282

83-
assert.equal(expected, actual);
83+
assert.equal(actual, expected);
8484
});
8585
});

__tests__/src/getProp-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ describe('getProp', () => {
1111
const expected = 'function';
1212
const actual = typeof getProp;
1313

14-
assert.equal(expected, actual);
14+
assert.equal(actual, expected);
1515
});
1616

1717
it('should return undefined if no arguments are provided', () => {
1818
const expected = undefined;
1919
const actual = getProp();
2020

21-
assert.equal(expected, actual);
21+
assert.equal(actual, expected);
2222
});
2323

2424
it('should return undefined if the attribute is absent', () => {
@@ -30,7 +30,7 @@ describe('getProp', () => {
3030
const expected = undefined;
3131
const actual = getProp(props, prop);
3232

33-
assert.equal(expected, actual);
33+
assert.equal(actual, expected);
3434
});
3535

3636
it('should return the correct attribute if the attribute exists', () => {
@@ -42,7 +42,7 @@ describe('getProp', () => {
4242
const expected = 'id';
4343
const actual = getProp(props, prop).name.name;
4444

45-
assert.equal(expected, actual);
45+
assert.equal(actual, expected);
4646
});
4747

4848
it('should return the correct attribute if the attribute exists in spread', () => {
@@ -54,7 +54,7 @@ describe('getProp', () => {
5454
const expected = 'id';
5555
const actual = getProp(props, prop).name.name;
5656

57-
assert.equal(expected, actual);
57+
assert.equal(actual, expected);
5858
});
5959

6060
it('should return the correct attribute if the attribute exists in spread as an expression', () => {
@@ -68,8 +68,8 @@ describe('getProp', () => {
6868
const actualName = actual.name.name;
6969
const actualValue = actual.value.expression.name;
7070

71-
assert.equal(expected, actualName);
72-
assert.equal(expected, actualValue);
71+
assert.equal(actualName, expected);
72+
assert.equal(actualValue, expected);
7373
});
7474

7575
it('should return the correct attribute if the attribute exists in spread (case sensitive)', () => {
@@ -82,7 +82,7 @@ describe('getProp', () => {
8282
const expected = 'id';
8383
const actual = getProp(props, prop, options).name.name;
8484

85-
assert.equal(expected, actual);
85+
assert.equal(actual, expected);
8686
});
8787

8888
it('should return undefined if the attribute does not exist in spread (case sensitive)', () => {
@@ -95,7 +95,7 @@ describe('getProp', () => {
9595
const expected = undefined;
9696
const actual = getProp(props, prop, options);
9797

98-
assert.equal(expected, actual);
98+
assert.equal(actual, expected);
9999
});
100100

101101
it('should return undefined for key in spread', () => {
@@ -108,7 +108,7 @@ describe('getProp', () => {
108108
const expected = undefined;
109109
const actual = getProp(props, prop);
110110

111-
assert.equal(expected, actual);
111+
assert.equal(actual, expected);
112112
});
113113

114114
it('should return undefined if the attribute may exist in spread', () => {
@@ -120,7 +120,7 @@ describe('getProp', () => {
120120
const expected = undefined;
121121
const actual = getProp(props, prop);
122122

123-
assert.equal(expected, actual);
123+
assert.equal(actual, expected);
124124
});
125125

126126
it('should not crash if the spread contains a spread', () => {
@@ -144,6 +144,6 @@ describe('getProp', () => {
144144
const expected = undefined;
145145
const actual = getProp(props, prop, options);
146146

147-
assert.equal(expected, actual);
147+
assert.equal(actual, expected);
148148
});
149149
});

0 commit comments

Comments
 (0)