Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jscs, pull 562
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());
});
@mikesherov

This comment has been minimized.

Copy link

commented Aug 26, 2014

The it on line 1 should say should instead of should not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.