Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
test(rules): add more tests to achieve higher code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dferber90 committed Mar 8, 2016
1 parent 12036a2 commit c460954
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/rules/prefer-session-equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const isSessionGetCallExpression = node => (
node.type === 'CallExpression' &&
node.callee.type === 'MemberExpression' &&
(
node.callee.type === 'MemberExpression' &&
node.callee.object.type === 'Identifier' && node.callee.object.name === 'Session' &&
(
(
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/prefer-session-equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const ruleTester = new RuleTester()

ruleTester.run('prefer-session-equals', rule, {
valid: [
'var x = 1',
'if(x()) {}',
'if (true) {}',
'if (Session["equals"]("foo", true)) {}',
'if (Session.equals("foo", true)) {}',
'if (Session.equals("foo", false)) {}',
'if (Session.equals("foo", 1)) {}',
Expand Down
7 changes: 7 additions & 0 deletions tests/lib/rules/template-naming-convention.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ ruleTester.run('template-naming-convention', rule, {
{ message: 'Invalid template naming convention, expected "camel-case"', type: 'MemberExpression' },
],
},
{
code: 'Template.foo_bar.helpers({})',
options: ['pascal-case'],
errors: [
{ message: 'Invalid template naming convention, expected "pascal-case"', type: 'MemberExpression' },
],
},
{
code: 'Template.fooBar.helpers({})',
options: ['snake-case'],
Expand Down

0 comments on commit c460954

Please sign in to comment.