Skip to content

Commit

Permalink
chore(package): update xo to version 0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed May 4, 2018
1 parent 4736d2a commit 859364b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"semantic-release": "^15.0.0",
"stringz": "^1.0.0",
"tempy": "^0.2.0",
"xo": "^0.20.0"
"xo": "^0.21.0"
},
"engines": {
"node": ">=6"
Expand Down Expand Up @@ -64,7 +64,8 @@
"all": true
},
"prettier": {
"printWidth": 120
"printWidth": 120,
"trailingComma": "es5"
},
"publishConfig": {
"access": "public"
Expand Down
10 changes: 5 additions & 5 deletions test/aliases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {types, typesOrder} from '../types';
*/
function hasProperty(t, object, prop, type) {
for (const obj in object) {
if (Object.prototype.hasOwnProperty.call(object, obj)) {
t.true(Object.prototype.hasOwnProperty.call(object[obj], prop));
if (Reflect.apply(Object.prototype.hasOwnProperty, object, [obj])) {
t.true(Reflect.apply(Object.prototype.hasOwnProperty, object[obj], [prop]));
if (type === 'string') {
t.true(typeof object[obj][prop] === type);
} else if (type === 'emoji') {
Expand All @@ -35,15 +35,15 @@ test('Each type has the property emoji', hasProperty, aliases, 'emoji', 'emoji')

test('Each alias`s type property has a value that exists in types', t => {
for (const alias in aliases) {
if (Object.prototype.hasOwnProperty.call(aliases, alias)) {
t.true(Object.prototype.hasOwnProperty.call(types, aliases[alias].type));
if (Reflect.apply(Object.prototype.hasOwnProperty, aliases, [alias])) {
t.true(Reflect.apply(Object.prototype.hasOwnProperty, types, [aliases[alias].type]));
}
}
});

test('Each alias exists in typesOrder', t => {
for (const type in types) {
if (Object.prototype.hasOwnProperty.call(types, type)) {
if (Reflect.apply(Object.prototype.hasOwnProperty, types, [type])) {
t.true(typesOrder.indexOf(type) !== -1);
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/types.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {types, typesOrder} from '../types';
*/
function hasProperty(t, object, prop, type) {
for (const obj in object) {
if (Object.prototype.hasOwnProperty.call(object, obj)) {
t.true(Object.prototype.hasOwnProperty.call(object[obj], prop));
if (Reflect.apply(Object.prototype.hasOwnProperty, object, [obj])) {
t.true(Reflect.apply(Object.prototype.hasOwnProperty, object[obj], [prop]));
if (type === 'boolean' || type === 'string' || type === 'number' || type === 'function') {
t.true(typeof object[obj][prop] === type);
} else if (type === 'emoji') {
Expand All @@ -37,11 +37,11 @@ function hasProperty(t, object, prop, type) {
*/
function hasValidRelease(t, object) {
for (const obj in object) {
if (Object.prototype.hasOwnProperty.call(object, obj)) {
t.true(Object.prototype.hasOwnProperty.call(object[obj], 'release'));
if (Reflect.apply(Object.prototype.hasOwnProperty, object, [obj])) {
t.true(Reflect.apply(Object.prototype.hasOwnProperty, object[obj], ['release']));
t.true(
['major', 'minor', 'patch', false].indexOf(object[obj].release) !== -1 ||
(Object.prototype.hasOwnProperty.call(object[obj].release, 'release') &&
(Reflect.apply(Object.prototype.hasOwnProperty, object[obj].release, ['release']) &&
['major', 'minor', 'patch', false].indexOf(object[obj].release.release) !== -1)
);
}
Expand All @@ -64,7 +64,7 @@ test('../types has the property typesOrder', t => {

test('Each type exists in typesOrder', t => {
for (const type in types) {
if (Object.prototype.hasOwnProperty.call(types, type)) {
if (Reflect.apply(Object.prototype.hasOwnProperty, types, [type])) {
t.true(typesOrder.indexOf(type) !== -1);
}
}
Expand Down

0 comments on commit 859364b

Please sign in to comment.