Created
August 26, 2014 11:29
-
-
Save markelog/625fdec212b938b43738 to your computer and use it in GitHub Desktop.
jscs, pull 562
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should not require between simple arguments', function() { | |
assert(checker.checkString('foo(a,b);').getErrorCount() === 2); | |
assert(checker.checkString('foo( a,b);').getErrorCount() === 1); | |
assert(checker.checkString('foo( a,b );').isEmpty()); | |
}); | |
it('should not require spaces for empty arguments list', function() { | |
assert(checker.checkString('foo();').isEmpty()); | |
}); | |
it('should require spaces for grouping parentheses', function() { | |
assert(checker.checkString('var test = (true ? true : false)').getErrorCount() === 2); | |
assert(checker.checkString('var test = ( true ? true : false)').getErrorCount() === 1); | |
assert(checker.checkString('var test = ( true ? true : false )').isEmpty()); | |
}); | |
it('should require spaces for "for" keyword', function() { | |
assert(checker.checkString('for (var i = 0; i < 100; i++)').getErrorCount() === 2); | |
assert(checker.checkString('for ( var i = 0; i < 100; i++)').getErrorCount() === 1); | |
assert(checker.checkString('for ( var i = 0; i < 100; i++ )').isEmpty()); | |
}); | |
it('should require spaces for "while" keyword', function() { | |
assert(checker.checkString('while (!condition)').getErrorCount() === 2); | |
assert(checker.checkString('while ( !condition)').getErrorCount() === 1); | |
assert(checker.checkString('while ( !condition )').isEmpty()); | |
}); | |
it('should require spaces for "while" keyword', function() { | |
assert(checker.checkString('while (!condition)').getErrorCount() === 2); | |
assert(checker.checkString('while ( !condition)').getErrorCount() === 1); | |
assert(checker.checkString('while ( !condition )').isEmpty()); | |
}); | |
it('should require spaces for "try...catch" statement', function() { | |
assert(checker.checkString('try {} catch(e)').getErrorCount() === 2); | |
assert(checker.checkString('try {} catch( e)').getErrorCount() === 1); | |
assert(checker.checkString('try {} catch( e )').isEmpty()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
it
on line 1 should sayshould
instead ofshould not
.