@@ -29,13 +29,13 @@ it('reports no errors on a project with valid exports', () => {
29
29
for ( const child of folder . children ) {
30
30
if ( child . type === 'file' ) {
31
31
const fileWithContent = child as FileWithContent
32
- if ( child . path . endsWith ( 'shared/ui/ index.ts' ) ) {
32
+ if ( child . path === joinFromRoot ( 'shared' , 'ui' , ' index.ts') ) {
33
33
fileWithContent . content = "export { Button } from './Button'"
34
- } else if ( child . path . endsWith ( 'entities/ user/ui/ index.ts' ) ) {
34
+ } else if ( child . path === joinFromRoot ( 'entities' , ' user' , 'ui' , ' index.ts') ) {
35
35
fileWithContent . content = "export { UserCard } from './UserCard'"
36
- } else if ( child . path . endsWith ( 'entities/ user/ index.ts' ) ) {
36
+ } else if ( child . path === joinFromRoot ( 'entities' , ' user' , ' index.ts') ) {
37
37
fileWithContent . content = "export * as userModel from './model'"
38
- } else if ( child . path . endsWith ( 'features/ auth/ui/ index.ts' ) ) {
38
+ } else if ( child . path === joinFromRoot ( 'features' , ' auth' , 'ui' , ' index.ts') ) {
39
39
fileWithContent . content = "export { LoginForm } from './LoginForm'"
40
40
} else {
41
41
fileWithContent . content = ''
@@ -69,9 +69,9 @@ it('reports errors on a project with wildcard exports', () => {
69
69
for ( const child of folder . children ) {
70
70
if ( child . type === 'file' ) {
71
71
const fileWithContent = child as FileWithContent
72
- if ( child . path . endsWith ( 'shared/ui/ index.ts' ) ) {
72
+ if ( child . path === joinFromRoot ( 'shared' , 'ui' , ' index.ts') ) {
73
73
fileWithContent . content = "export * from './Button'"
74
- } else if ( child . path . endsWith ( 'entities/ user/ui/ index.ts' ) ) {
74
+ } else if ( child . path === joinFromRoot ( 'entities' , ' user' , 'ui' , ' index.ts') ) {
75
75
fileWithContent . content = "export * from './UserCard'"
76
76
} else {
77
77
fileWithContent . content = ''
@@ -116,9 +116,9 @@ it('allows export * as namespace pattern', () => {
116
116
for ( const child of folder . children ) {
117
117
if ( child . type === 'file' ) {
118
118
const fileWithContent = child as FileWithContent
119
- if ( child . path . endsWith ( 'shared/ui/ index.ts' ) ) {
119
+ if ( child . path === joinFromRoot ( 'shared' , 'ui' , ' index.ts') ) {
120
120
fileWithContent . content = "export * as positions from './positions'"
121
- } else if ( child . path . endsWith ( 'entities/ user/ index.ts' ) ) {
121
+ } else if ( child . path === joinFromRoot ( 'entities' , ' user' , ' index.ts') ) {
122
122
fileWithContent . content = "export * as userModel from './model'"
123
123
} else {
124
124
fileWithContent . content = ''
@@ -233,15 +233,15 @@ it('allows wildcard exports in unsliced layers (shared and app)', () => {
233
233
for ( const child of folder . children ) {
234
234
if ( child . type === 'file' ) {
235
235
const fileWithContent = child as FileWithContent
236
- if ( child . path . endsWith ( 'shared/ui/ index.ts' ) ) {
236
+ if ( child . path === joinFromRoot ( 'shared' , 'ui' , ' index.ts') ) {
237
237
fileWithContent . content = "export * from './Button'\nexport * from './Modal'"
238
- } else if ( child . path . endsWith ( 'shared/ api/ index.ts' ) ) {
238
+ } else if ( child . path === joinFromRoot ( 'shared' , ' api' , ' index.ts') ) {
239
239
fileWithContent . content = "export * from './client'\nexport * from './endpoints'"
240
- } else if ( child . path . endsWith ( 'app/ providers/ index.ts' ) ) {
240
+ } else if ( child . path === joinFromRoot ( 'app' , ' providers' , ' index.ts') ) {
241
241
fileWithContent . content = "export * from './AuthProvider'\nexport * from './ThemeProvider'"
242
- } else if ( child . path . endsWith ( 'app/ routes/ index.ts' ) ) {
242
+ } else if ( child . path === joinFromRoot ( 'app' , ' routes' , ' index.ts') ) {
243
243
fileWithContent . content = "export * from './home'\nexport * from './auth'"
244
- } else if ( child . path . endsWith ( 'entities/ user/ui/ index.ts' ) ) {
244
+ } else if ( child . path === joinFromRoot ( 'entities' , ' user' , 'ui' , ' index.ts') ) {
245
245
fileWithContent . content = "export { UserCard } from './UserCard'"
246
246
} else {
247
247
fileWithContent . content = ''
0 commit comments