@@ -19,24 +19,26 @@ import { getErrorMessage } from "./util";
1919
2020setupTests ( test ) ;
2121
22- for ( const [ key , displayName ] of Object . entries (
23- statusReport . ACTION_DISPLAY_NAMES ,
24- ) ) {
25- test ( `getDisplayActionName - '${ displayName } ' instead of '${ key } '` , ( t ) => {
22+ const expectedActionDisplayNames : Record < ActionName , string > = {
23+ [ ActionName . Analyze ] : "analyze action" ,
24+ [ ActionName . AnalyzePost ] : "analyze post-action" ,
25+ [ ActionName . Autobuild ] : "autobuild action" ,
26+ [ ActionName . Init ] : "init action" ,
27+ [ ActionName . InitPost ] : "init post-action" ,
28+ [ ActionName . ResolveEnvironment ] : "resolve-environment action" ,
29+ [ ActionName . SetupCodeQL ] : "setup-codeql action" ,
30+ [ ActionName . StartProxy ] : "start-proxy action" ,
31+ [ ActionName . StartProxyPost ] : "start-proxy post-action" ,
32+ [ ActionName . UploadSarif ] : "upload-sarif action" ,
33+ [ ActionName . UploadSarifPost ] : "upload-sarif post-action" ,
34+ } ;
35+
36+ for ( const [ key , displayName ] of Object . entries ( expectedActionDisplayNames ) ) {
37+ test ( `getDisplayActionName - '${ displayName } ' for '${ key } '` , ( t ) => {
2638 t . is ( statusReport . getDisplayActionName ( key as ActionName ) , displayName ) ;
2739 } ) ;
2840}
2941
30- test ( "getDisplayActionName - returns action name" , ( t ) => {
31- for ( const actionName of Object . values ( ActionName ) ) {
32- if ( statusReport . ACTION_DISPLAY_NAMES [ actionName ] ) {
33- continue ;
34- }
35-
36- t . is ( statusReport . getDisplayActionName ( actionName ) , actionName ) ;
37- }
38- } ) ;
39-
4042interface RunInActionsTestOpts {
4143 runFn ?: ( ) => Promise < any > ;
4244 expectedErrorMessage ?: string ;
@@ -109,7 +111,7 @@ const runInActionsMacro = makeMacro({
109111 if ( expectFailure ) {
110112 t . true (
111113 setFailed . calledOnceWithExactly (
112- `${ statusReport . getDisplayActionName ( name ) } action failed: ${ opts ?. expectedErrorMessage } ` ,
114+ `${ statusReport . getDisplayActionName ( name ) } failed: ${ opts ?. expectedErrorMessage } ` ,
113115 ) ,
114116 ) ;
115117 t . true (
0 commit comments