Skip to content

Commit 2118b74

Browse files
Merge branch 'development' of github.com:Gillespie59/eslint-plugin-angular into development
2 parents f665179 + b909bc9 commit 2118b74

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

rules/controller-name.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module.exports = function(context) {
2020
var callee = node.callee;
2121
if(callee.type === 'MemberExpression' && callee.property.name === 'controller') {
2222
/**
23-
* Issue #124 for controller() calls inside karma tests
24-
*/
25-
if(node.arguments.length === 0){
23+
* Allow the usage of element.controller() and element.controller('directiveName') in unittests
24+
*/
25+
if(node.arguments.length < 2){
2626
return;
2727
}
2828

test/controller-name.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ eslintTester.run('controller-name', rule, {
2929
}, {
3030
code: 'controller = el.controller();',
3131
options: ['/[A-Z].*Controller$/']
32+
}, {
33+
code: 'controller = el.controller("no-match");',
34+
options: ['/^SpamController$/']
3235
}],
3336
invalid: [
3437
{

0 commit comments

Comments
 (0)