@@ -13,28 +13,28 @@ ruleTester.run('no-cross-imports', rule, {
1313 'someFunction();' ,
1414 {
1515 options : [ { allow : '@test/workspace' } ] ,
16- filename : '/some/path' ,
16+ filename : '/some/path.js ' ,
1717 code : "import '@test/workspace';" ,
1818 } ,
1919 {
2020 options : [ { allow : [ '@test/workspace' , '@test/another-workspace' ] } ] ,
21- filename : '/some/path' ,
21+ filename : '/some/path.js ' ,
2222 code : "import '@test/workspace';import '@test/another-workspace';" ,
2323 } ,
2424 {
25- filename : '/test/workspace' ,
25+ filename : '/test/workspace/test.js ' ,
2626 code : "import '@test/workspace';" ,
2727 } ,
2828 {
29- filename : '/test/workspace' ,
29+ filename : '/test/workspace/test.js ' ,
3030 code : "import './some/thing'" ,
3131 } ,
3232 ] ,
3333
3434 invalid : [
3535 {
3636 code : "import workspace from '@test/workspace';" ,
37- filename : '/some/path' ,
37+ filename : '/some/path.js ' ,
3838 errors : [
3939 {
4040 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -43,7 +43,7 @@ ruleTester.run('no-cross-imports', rule, {
4343 } ,
4444 {
4545 code : "import('@test/workspace');" ,
46- filename : '/some/path' ,
46+ filename : '/some/path.js ' ,
4747 errors : [
4848 {
4949 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -52,7 +52,7 @@ ruleTester.run('no-cross-imports', rule, {
5252 } ,
5353 {
5454 code : "require('@test/workspace');" ,
55- filename : '/some/path' ,
55+ filename : '/some/path.js ' ,
5656 errors : [
5757 {
5858 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -61,7 +61,7 @@ ruleTester.run('no-cross-imports', rule, {
6161 } ,
6262 {
6363 code : "import workspace from '@test/workspace';" ,
64- filename : '/some/path' ,
64+ filename : '/some/path.js ' ,
6565 errors : [
6666 {
6767 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -70,7 +70,7 @@ ruleTester.run('no-cross-imports', rule, {
7070 } ,
7171 {
7272 code : "import '@test/workspace';" ,
73- filename : '/some/path' ,
73+ filename : '/some/path.js ' ,
7474 errors : [
7575 {
7676 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -79,7 +79,7 @@ ruleTester.run('no-cross-imports', rule, {
7979 } ,
8080 {
8181 code : "import '@test/workspace/some/path';" ,
82- filename : '/some/path' ,
82+ filename : '/some/path.js ' ,
8383 errors : [
8484 {
8585 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -88,7 +88,7 @@ ruleTester.run('no-cross-imports', rule, {
8888 } ,
8989 {
9090 code : "import '../../test/workspace';" ,
91- filename : '/some/path' ,
91+ filename : '/some/path.js ' ,
9292 errors : [
9393 {
9494 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -97,7 +97,7 @@ ruleTester.run('no-cross-imports', rule, {
9797 } ,
9898 {
9999 code : "import '../../test/workspace/some/path';" ,
100- filename : '/some/path' ,
100+ filename : '/some/path.js ' ,
101101 errors : [
102102 {
103103 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -106,7 +106,7 @@ ruleTester.run('no-cross-imports', rule, {
106106 } ,
107107 {
108108 code : "import '@test/workspace';import '@test/another-workspace';" ,
109- filename : '/some/path' ,
109+ filename : '/some/path.js ' ,
110110 errors : [
111111 {
112112 message : 'Import from package "@test/workspace" is not allowed' ,
@@ -120,7 +120,7 @@ ruleTester.run('no-cross-imports', rule, {
120120 {
121121 code : "import '@test/workspace';import '@test/another-workspace';" ,
122122 options : [ { allow : '@test/workspace' } ] ,
123- filename : '/some/path' ,
123+ filename : '/some/path.js ' ,
124124 errors : [
125125 {
126126 message :
@@ -130,13 +130,23 @@ ruleTester.run('no-cross-imports', rule, {
130130 } ,
131131 {
132132 options : [ { allow : '@test/workspacetest' } ] ,
133- filename : '/some/path' ,
133+ filename : '/some/path.js ' ,
134134 code : "import '@test/workspace';" ,
135135 errors : [
136136 {
137137 message : 'Import from package "@test/workspace" is not allowed' ,
138138 } ,
139139 ] ,
140140 } ,
141+ {
142+ filename : '/test/workspace/test.js' ,
143+ code : "import '../another-workspace/test'" ,
144+ errors : [
145+ {
146+ message :
147+ 'Import from package "@test/another-workspace" is not allowed' ,
148+ } ,
149+ ] ,
150+ } ,
141151 ] ,
142152} ) ;
0 commit comments