@@ -41,8 +41,8 @@ describe("command-analysis explanation summary", () => {
4141 expect ( summary . warningLines ) . toEqual ( [ "Contains inline-eval: python3 -c" ] ) ;
4242 } ) ;
4343
44- it ( "resolves node display summaries from argv" , ( ) => {
45- const summary = resolveCommandAnalysisSummaryForDisplay ( {
44+ it ( "resolves node display summaries from argv" , async ( ) => {
45+ const summary = await resolveCommandAnalysisSummaryForDisplay ( {
4646 host : "node" ,
4747 commandText : "python3 script.py" ,
4848 commandArgv : [ "python3" , "-c" , "print(1)" ] ,
@@ -52,15 +52,15 @@ describe("command-analysis explanation summary", () => {
5252 expect ( summary ?. warningLines ) . toEqual ( [ "Contains inline-eval: python3 -c" ] ) ;
5353
5454 expect (
55- resolveCommandAnalysisSummaryForDisplay ( {
55+ await resolveCommandAnalysisSummaryForDisplay ( {
5656 host : "node" ,
5757 commandText : "python3 -c 'print(1)'" ,
5858 } ) ,
5959 ) . toBeNull ( ) ;
6060 } ) ;
6161
62- it ( "resolves gateway display summaries from shell text even when argv is stale" , ( ) => {
63- const summary = resolveCommandAnalysisSummaryForDisplay ( {
62+ it ( "resolves gateway display summaries from shell text even when argv is stale" , async ( ) => {
63+ const summary = await resolveCommandAnalysisSummaryForDisplay ( {
6464 host : "gateway" ,
6565 commandText : "python3 -c 'print(1)'" ,
6666 commandArgv : [ "python3" , "script.py" ] ,
@@ -70,18 +70,22 @@ describe("command-analysis explanation summary", () => {
7070 expect ( summary ?. warningLines ) . toEqual ( [ "Contains inline-eval: python3 -c" ] ) ;
7171
7272 expect (
73- resolveCommandAnalysisSummaryForDisplay ( {
74- host : "gateway" ,
75- commandText : "echo ok" ,
76- commandArgv : [ "python3" , "-c" , "print(1)" ] ,
77- } ) ?. riskKinds ,
73+ (
74+ await resolveCommandAnalysisSummaryForDisplay ( {
75+ host : "gateway" ,
76+ commandText : "echo ok" ,
77+ commandArgv : [ "python3" , "-c" , "print(1)" ] ,
78+ } )
79+ ) ?. riskKinds ,
7880 ) . toStrictEqual ( [ ] ) ;
7981 expect (
80- resolveCommandAnalysisSummaryForDisplay ( {
81- host : "gateway" ,
82- commandText : "python3 -c 'print(1)'" ,
83- sanitizeText : ( value ) => value . replaceAll ( "python3" , "python" ) ,
84- } ) ?. warningLines ,
82+ (
83+ await resolveCommandAnalysisSummaryForDisplay ( {
84+ host : "gateway" ,
85+ commandText : "python3 -c 'print(1)'" ,
86+ sanitizeText : ( value ) => value . replaceAll ( "python3" , "python" ) ,
87+ } )
88+ ) ?. warningLines ,
8589 ) . toEqual ( [ "Contains inline-eval: python -c" ] ) ;
8690 } ) ;
8791} ) ;
0 commit comments