@@ -5,13 +5,12 @@ import type * as types from "../../types";
55// Mock @actions/core
66const mockInfo = vi . fn ( ) ;
77vi . mock ( "@actions/core" , ( ) => ( {
8- info : ( ...args : any [ ] ) => mockInfo ( ...args ) ,
8+ info : ( ...args : unknown [ ] ) => mockInfo ( ...args ) ,
99 warning : vi . fn ( ) ,
1010} ) ) ;
1111
1212// Mock conda
1313const mockCondaCommand = vi . fn ( async ( ) => { } ) ;
14- const mockApplyCondaConfiguration = vi . fn ( async ( ) => { } ) ;
1514
1615// Mock utils
1716vi . mock ( "../../utils" , ( ) => ( {
@@ -46,9 +45,7 @@ vi.mock("../../constants", () => ({
4645
4746// Mock conda functions used by update-mamba's postInstall
4847vi . mock ( "../../conda" , async ( ) => ( {
49- condaCommand : ( ...args : any [ ] ) => mockCondaCommand ( ...args ) ,
50- applyCondaConfiguration : ( ...args : any [ ] ) =>
51- mockApplyCondaConfiguration ( ...args ) ,
48+ condaCommand : ( ...args : unknown [ ] ) => mockCondaCommand ( ...args ) ,
5249 condaExecutable : vi . fn ( ( ) => "/opt/conda/bin/mamba" ) ,
5350 condaBasePath : vi . fn ( ( ) => "/opt/conda" ) ,
5451} ) ) ;
@@ -118,7 +115,6 @@ describe("installBaseTools", () => {
118115 beforeEach ( async ( ) => {
119116 vi . resetModules ( ) ;
120117 mockCondaCommand . mockReset ( ) ;
121- mockApplyCondaConfiguration . mockReset ( ) ;
122118 mockInfo . mockReset ( ) ;
123119 const mod = await import ( "../../base-tools/index" ) ;
124120 installBaseTools = mod . installBaseTools ;
@@ -131,7 +127,6 @@ describe("installBaseTools", () => {
131127 await installBaseTools ( inputs , options ) ;
132128
133129 expect ( mockCondaCommand ) . not . toHaveBeenCalled ( ) ;
134- expect ( mockApplyCondaConfiguration ) . not . toHaveBeenCalled ( ) ;
135130 expect ( mockInfo ) . toHaveBeenCalledWith (
136131 "No tools were installed in 'base' env." ,
137132 ) ;
@@ -151,18 +146,13 @@ describe("installBaseTools", () => {
151146 ) ;
152147 } ) ;
153148
154- it ( "calls applyCondaConfiguration with reapply=true after install " , async ( ) => {
149+ it ( "does not call applyCondaConfiguration (config is written upfront) " , async ( ) => {
155150 const inputs = makeInputs ( { condaVersion : "23.1.0" } ) ;
156151 const options = makeOptions ( ) ;
157152
158153 await installBaseTools ( inputs , options ) ;
159154
160- expect ( mockApplyCondaConfiguration ) . toHaveBeenCalledTimes ( 1 ) ;
161- expect ( mockApplyCondaConfiguration ) . toHaveBeenCalledWith (
162- inputs ,
163- expect . any ( Object ) ,
164- true ,
165- ) ;
155+ expect ( mockCondaCommand ) . toHaveBeenCalledTimes ( 1 ) ;
166156 } ) ;
167157
168158 it ( "installs multiple tools in a single conda command" , async ( ) => {
0 commit comments