Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Misc: fixup last test with timeout, empty block test
Browse files Browse the repository at this point in the history
Closes gh-2184
  • Loading branch information
hzoo committed Mar 23, 2016
1 parent 0cc861a commit c86d078
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/rules/disallow-empty-blocks.js
Expand Up @@ -93,7 +93,8 @@ module.exports.prototype = {
if (node.parentElement.type !== 'CatchClause' &&
node.parentElement.type !== 'FunctionDeclaration' &&
node.parentElement.type !== 'FunctionExpression' &&
node.parentElement.type !== 'ArrowFunctionExpression') {
node.parentElement.type !== 'ArrowFunctionExpression' &&
node.parentElement.type !== 'ObjectMethod') {
errors.add('Empty block found', node.lastChild);
}
});
Expand Down
4 changes: 4 additions & 0 deletions test/specs/rules/disallow-empty-blocks.js
Expand Up @@ -141,6 +141,10 @@ describe('rules/disallow-empty-blocks', function() {
expect(checker.checkString('(a) => {}')).to.have.no.errors();
});

it('should not report empty object method', function() {
expect(checker.checkString('var a = { b() {} }')).to.have.no.errors();
});

describe('allExcept: ["comments"]', function() {
beforeEach(function() {
checker = new Checker();
Expand Down
1 change: 1 addition & 0 deletions test/specs/rules/disallow-spaces-in-generator.js
Expand Up @@ -160,6 +160,7 @@ describe('rules/disallow-spaces-in-generator', function() {
output: 'var x = function*asdf(){}'
});

// TODO: fix in CST
reportAndFix({
name: 'should report illegal space after the star for the shorthand',
rules: rules,
Expand Down
1 change: 1 addition & 0 deletions test/specs/rules/require-spaces-in-generator.js
Expand Up @@ -90,6 +90,7 @@ describe('rules/require-spaces-in-generator', function() {
output: 'var x = function * asdf(){}'
});

// TODO: fix in CST
reportAndFix({
name: 'should report missing space after the star for the shorthand',
rules: rules,
Expand Down
4 changes: 3 additions & 1 deletion test/specs/string-checker.js
Expand Up @@ -376,7 +376,9 @@ describe('string-checker', function() {
});
});

describe.skip('presets', function() {
describe('presets', function() {
this.timeout(30000);

testPreset('airbnb');
testPreset('crockford');
testPreset('google');
Expand Down

0 comments on commit c86d078

Please sign in to comment.