File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ export const getKeyFromObject = (element: RemoteChangeElement | ChangeResult): s
22
22
} ;
23
23
24
24
export const isBundle = ( cmp : SourceComponent ) : boolean => cmp . type . strategies ?. adapter === 'bundle' ;
25
+ export const isLwcLocalOnlyTest = ( filePath : string ) : boolean =>
26
+ filePath . includes ( '__utam__' ) || filePath . includes ( '__tests__' ) ;
25
27
26
28
/**
27
29
* Verify that a filepath starts exactly with a complete parent path
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import * as os from 'os';
10
10
import * as fs from 'graceful-fs' ;
11
11
import { NamedPackageDir , Logger , SfError } from '@salesforce/core' ;
12
12
import * as git from 'isomorphic-git' ;
13
- import { chunkArray , pathIsInFolder } from './functions' ;
13
+ import { chunkArray , isLwcLocalOnlyTest , pathIsInFolder } from './functions' ;
14
14
15
15
/** returns the full path to where we store the shadow repo */
16
16
const getGitDir = ( orgId : string , projectPath : string , useSfdxTrackingFiles = false ) : string => {
@@ -134,7 +134,7 @@ export class ShadowRepo {
134
134
// no hidden files
135
135
! f . includes ( `${ path . sep } .` ) &&
136
136
// no lwc tests
137
- ! f . includes ( '__tests__' ) &&
137
+ ! isLwcLocalOnlyTest ( f ) &&
138
138
// no gitignore files
139
139
! f . endsWith ( '.gitignore' ) &&
140
140
// isogit uses `startsWith` for filepaths so it's possible to get a false positive
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { isString } from '@salesforce/ts-types';
9
9
import { MetadataResolver , VirtualTreeContainer , ForceIgnore } from '@salesforce/source-deploy-retrieve' ;
10
10
import { ChangeResult } from './types' ;
11
11
import { sourceComponentGuard } from './guards' ;
12
- import { ensureRelative } from './functions' ;
12
+ import { ensureRelative , isLwcLocalOnlyTest } from './functions' ;
13
13
const logger = Logger . childFromRoot ( 'SourceTracking.PopulateTypesAndNames' ) ;
14
14
15
15
/**
@@ -74,8 +74,8 @@ export const populateTypesAndNames = ({
74
74
const filenamesFromMatchingComponent = [ matchingComponent . xml , ...matchingComponent . walkContent ( ) ] ;
75
75
const ignored = filenamesFromMatchingComponent
76
76
. filter ( isString )
77
- . filter ( ( filename ) => ! filename . includes ( '__tests__' ) )
78
- . some ( ( filename ) => forceIgnore ?. denies ( filename ) ) ;
77
+ . filter ( ( f ) => ! isLwcLocalOnlyTest ( f ) )
78
+ . some ( ( f ) => forceIgnore ?. denies ( f ) ) ;
79
79
filenamesFromMatchingComponent . map ( ( filename ) => {
80
80
if ( filename && elementMap . has ( filename ) ) {
81
81
// add the type/name from the componentSet onto the element
You can’t perform that action at this time.
0 commit comments