File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ const { execSync } = require ( 'child_process' ) ;
2+ const path = require ( 'path' ) ;
3+ const euiRoot = path . resolve ( __dirname , '../../' ) ;
4+
5+ describe ( 'test-staged.js' , ( ) => {
6+ it ( 'does not have --findRelatedTests regressions due to imports from src/components' , ( ) => {
7+ const outputString = execSync (
8+ 'yarn test-unit --findRelatedTests --listTests src/components/beacon/beacon.tsx' ,
9+ { cwd : euiRoot }
10+ ) . toString ( ) ;
11+ const output = outputString
12+ . split ( '\n' )
13+ . filter ( ( item ) => item . includes ( 'eui/src/components' ) ) ;
14+
15+ expect (
16+ output [ 0 ] . endsWith ( 'eui/src/components/tour/tour_step.test.tsx' )
17+ ) . toBeTruthy ( ) ;
18+ expect (
19+ output [ 1 ] . endsWith ( 'eui/src/components/beacon/beacon.test.tsx' )
20+ ) . toBeTruthy ( ) ;
21+
22+ expect ( output [ 2 ] ) . toBeUndefined ( ) ;
23+ } ) ;
24+ } ) ;
You can’t perform that action at this time.
0 commit comments