File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import {
2+ toPath ,
3+ } from '../@internal/File' ;
4+
5+ import {
6+ serialized ,
7+ } from '../@internal/FilesystemPath' ;
8+
9+ import {
10+ TestableUnit ,
11+ } from './TestableUnit' ;
12+
13+ const unitsWithoutCompanions = TestableUnit . getAllThatAreMissingTestCompanion ( ) ;
14+
15+ if ( unitsWithoutCompanions === null ) {
16+ console . error ( 'Could not determine which units are missing test companions' ) ;
17+ process . exit ( 1 ) ;
18+ }
19+ else if (
20+ unitsWithoutCompanions . length === 0
21+ ) process . exit ( 0 ) ;
22+
23+ const pathFromCurrentModuleToProjectRoot = '../' ;
24+
25+ const projectRoot = toPath ( new URL (
26+ pathFromCurrentModuleToProjectRoot ,
27+ import . meta. url ,
28+ ) ) ;
29+
30+ const absolutePathToProjectRoot = serialized ( projectRoot ) ;
31+
32+ const serializedUnitsWithoutCompanions = unitsWithoutCompanions
33+ . map ( $0 => serialized ( $0 ) . replace ( absolutePathToProjectRoot , '' ) )
34+ . join ( '\n' ) ;
35+
36+ console . error ( `The following ${ unitsWithoutCompanions . length . toString ( ) } unit(s) have no test companion:\n${ serializedUnitsWithoutCompanions } ` ) ;
37+ process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments