5
5
const rule = require ( '../../../lib/rules/require-return-from-computed' ) ;
6
6
const RuleTester = require ( 'eslint' ) . RuleTester ;
7
7
8
+ const { ERROR_MESSAGE } = rule ;
9
+
8
10
// ------------------------------------------------------------------------------
9
11
// Tests
10
12
// ------------------------------------------------------------------------------
@@ -40,7 +42,8 @@ eslintTester.run('require-return-from-computed', rule, {
40
42
output : null ,
41
43
errors : [
42
44
{
43
- message : 'Always return a value from computed properties' ,
45
+ message : ERROR_MESSAGE ,
46
+ type : 'FunctionExpression' ,
44
47
} ,
45
48
] ,
46
49
} ,
@@ -49,7 +52,8 @@ eslintTester.run('require-return-from-computed', rule, {
49
52
output : null ,
50
53
errors : [
51
54
{
52
- message : 'Always return a value from computed properties' ,
55
+ message : ERROR_MESSAGE ,
56
+ type : 'FunctionExpression' ,
53
57
} ,
54
58
] ,
55
59
} ,
@@ -58,10 +62,12 @@ eslintTester.run('require-return-from-computed', rule, {
58
62
output : null ,
59
63
errors : [
60
64
{
61
- message : 'Always return a value from computed properties' ,
65
+ message : ERROR_MESSAGE ,
66
+ type : 'FunctionExpression' ,
62
67
} ,
63
68
{
64
- message : 'Always return a value from computed properties' ,
69
+ message : ERROR_MESSAGE ,
70
+ type : 'FunctionExpression' ,
65
71
} ,
66
72
] ,
67
73
} ,
@@ -70,7 +76,8 @@ eslintTester.run('require-return-from-computed', rule, {
70
76
output : null ,
71
77
errors : [
72
78
{
73
- message : 'Always return a value from computed properties' ,
79
+ message : ERROR_MESSAGE ,
80
+ type : 'FunctionExpression' ,
74
81
} ,
75
82
] ,
76
83
} ,
@@ -79,7 +86,8 @@ eslintTester.run('require-return-from-computed', rule, {
79
86
output : null ,
80
87
errors : [
81
88
{
82
- message : 'Always return a value from computed properties' ,
89
+ message : ERROR_MESSAGE ,
90
+ type : 'FunctionExpression' ,
83
91
} ,
84
92
] ,
85
93
} ,
0 commit comments