Skip to content

Commit aff39b5

Browse files
committed
test: improve unit case for pascal case
1 parent ca6a908 commit aff39b5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/lib/rules/filename-naming-convention.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ ruleTester.run(
116116
filename: 'src/utils/CalculatePrice.js',
117117
options: [{ '*.js': 'PASCAL_CASE', '*.jsx': 'PASCAL_CASE' }],
118118
},
119+
{
120+
code: "var foo = 'bar';",
121+
filename: 'src/utils/Calculate2Price.js',
122+
options: [{ '*.js': 'PASCAL_CASE', '*.jsx': 'PASCAL_CASE' }],
123+
},
119124
],
120125

121126
invalid: [
@@ -184,6 +189,19 @@ ruleTester.run(
184189
},
185190
],
186191
},
192+
{
193+
code: "var foo = 'bar';",
194+
filename: 'src/utils/2CalculatePrice.js',
195+
options: [{ '*.js': 'PASCAL_CASE', '*.jsx': 'PASCAL_CASE' }],
196+
errors: [
197+
{
198+
message:
199+
'The filename "2CalculatePrice.js" does not match the "PASCAL_CASE" style',
200+
column: 1,
201+
line: 1,
202+
},
203+
],
204+
},
187205
],
188206
}
189207
);

0 commit comments

Comments
 (0)