@@ -258,7 +258,7 @@ describe(validateConfig, () => {
258258
259259 expect ( ( ) => {
260260 validateConfig ( BuildConfigSchema , buildConfig ) ;
261- } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .r u n .e n v .E N V 1 " m u s t b e a s t r i n g / ) ;
261+ } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .r u n .e n v .E N V 1 " m u s t b e o n e o f \[ n u m b e r , s t r i n g \] / ) ;
262262 } ) ;
263263 test ( 'invalid env type' , ( ) => {
264264 const buildConfig = {
@@ -278,7 +278,27 @@ describe(validateConfig, () => {
278278
279279 expect ( ( ) => {
280280 validateConfig ( BuildConfigSchema , buildConfig ) ;
281- } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .r u n .e n v .E N V 1 " m u s t b e a s t r i n g / ) ;
281+ } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .r u n .e n v .E N V 1 " m u s t b e o n e o f \[ n u m b e r , s t r i n g \] / ) ;
282+ } ) ;
283+ test ( 'env number coerced to string' , ( ) => {
284+ const buildConfig = {
285+ build : {
286+ steps : [
287+ {
288+ run : {
289+ command : 'echo 123' ,
290+ env : {
291+ HOMEBREW_NO_AUTO_UPDATE : 1 ,
292+ } ,
293+ } ,
294+ } ,
295+ ] ,
296+ } ,
297+ } ;
298+
299+ const config = validateConfig ( BuildConfigSchema , buildConfig ) ;
300+ assert ( isBuildStepCommandRun ( config . build . steps [ 0 ] ) ) ;
301+ expect ( config . build . steps [ 0 ] . run . env ) . toEqual ( { HOMEBREW_NO_AUTO_UPDATE : '1' } ) ;
282302 } ) ;
283303 test ( 'valid timeout_minutes' , ( ) => {
284304 const buildConfig = {
@@ -518,7 +538,7 @@ describe(validateConfig, () => {
518538
519539 expect ( ( ) => {
520540 validateConfig ( BuildConfigSchema , buildConfig ) ;
521- } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .s a y _ h i .e n v .E N V 1 " m u s t b e a s t r i n g / ) ;
541+ } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .s a y _ h i .e n v .E N V 1 " m u s t b e o n e o f \[ n u m b e r , s t r i n g \] / ) ;
522542 } ) ;
523543 test ( 'invalid env structure' , ( ) => {
524544 const buildConfig = {
@@ -544,7 +564,7 @@ describe(validateConfig, () => {
544564
545565 expect ( ( ) => {
546566 validateConfig ( BuildConfigSchema , buildConfig ) ;
547- } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .s a y _ h i .e n v .E N V 1 " m u s t b e a s t r i n g / ) ;
567+ } ) . toThrowError ( / " b u i l d .s t e p s \[ 0 \] .s a y _ h i .e n v .E N V 1 " m u s t b e o n e o f \[ n u m b e r , s t r i n g \] / ) ;
548568 } ) ;
549569 test ( 'call with inputs boolean' , ( ) => {
550570 const buildConfig = {
0 commit comments