@@ -21,6 +21,10 @@ util.loadAvaHelper = () => ({
21
21
switch ( importPath ) {
22
22
case toPath ( 'lib/foo.test.js' ) :
23
23
return { isHelper : false , isSource : false , isTest : true } ;
24
+ case toPath ( '../foo.test.js' ) :
25
+ return { isHelper : false , isSource : false , isTest : true } ;
26
+ case toPath ( '@foo/bar' ) : // Regression test for https://github.com/avajs/eslint-plugin-ava/issues/253
27
+ return { isHelper : false , isSource : false , isTest : true } ;
24
28
default :
25
29
return { isHelper : false , isSource : false , isTest : false } ;
26
30
}
@@ -36,6 +40,8 @@ const errors = [
36
40
ruleTester . run ( 'no-import-test-files' , rule , {
37
41
valid : [
38
42
'import test from \'ava\';' ,
43
+ 'import foo from \'@foo/bar\';' ,
44
+ 'import foo from \'/foo/bar\';' , // Classfied as not a test.
39
45
'const test = require(\'ava\');' ,
40
46
'console.log()' ,
41
47
'const value = require(somePath);' ,
@@ -52,6 +58,11 @@ ruleTester.run('no-import-test-files', rule, {
52
58
code : 'const test = require(\'./foo.test.js\');' ,
53
59
filename : toPath ( 'lib/foo.js' ) ,
54
60
errors
61
+ } ,
62
+ {
63
+ code : 'const test = require(\'../foo.test.js\');' ,
64
+ filename : toPath ( 'foo.js' ) ,
65
+ errors
55
66
}
56
67
]
57
68
} ) ;
0 commit comments