Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking] add ChainExpression; CallExpression now includes arguments #102

Merged
merged 3 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions __tests__/src/elementType-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('elementType tests', () => {
const expected = 'function';
const actual = typeof elementType;

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});
});
24 changes: 12 additions & 12 deletions __tests__/src/getProp-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ describe('getProp', () => {
const expected = 'function';
const actual = typeof getProp;

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actualName);
assert.equal(expected, actualValue);
assert.equal(actualName, expected);
assert.equal(actualValue, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});

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

assert.equal(expected, actual);
assert.equal(actual, expected);
});
});
Loading