@@ -128,9 +128,20 @@ describe('parseVersion', () => {
128128 test . each ( [
129129 [ 'github.com/docker/buildx 0.4.1+azure bda4882a65349ca359216b135896bddc1d92461c' , '0.4.1' ] ,
130130 [ 'github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c' , '0.4.1' ] ,
131- [ 'github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2' , '0.4.2' ]
131+ [ 'github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2' , '0.4.2' ] ,
132+ [ 'github.com/docker/buildx f117971 f11797113e5a9b86bd976329c5dbb8a8bfdfadfa' , 'f117971' ]
132133 ] ) ( 'given %p' , async ( stdout , expected ) => {
133- expect ( await buildx . parseVersion ( stdout ) ) . toEqual ( expected ) ;
134+ expect ( buildx . parseVersion ( stdout ) ) . toEqual ( expected ) ;
135+ } ) ;
136+ } ) ;
137+
138+ describe ( 'satisfies' , ( ) => {
139+ test . each ( [
140+ [ '0.4.1' , '>=0.3.2' , true ] ,
141+ [ 'bda4882a65349ca359216b135896bddc1d92461c' , '>0.1.0' , false ] ,
142+ [ 'f117971' , '>0.6.0' , true ]
143+ ] ) ( 'given %p' , async ( version , range , expected ) => {
144+ expect ( buildx . satisfies ( version , range ) ) . toBe ( expected ) ;
134145 } ) ;
135146} ) ;
136147
@@ -142,13 +153,7 @@ describe('getSecret', () => {
142153 [ 'aaaaaaaa' , false , '' , '' , true ] ,
143154 [ 'aaaaaaaa=' , false , '' , '' , true ] ,
144155 [ '=bbbbbbb' , false , '' , '' , true ] ,
145- [
146- `foo=${ path . join ( __dirname , 'fixtures' , 'secret.txt' ) . split ( path . sep ) . join ( path . posix . sep ) } ` ,
147- true ,
148- 'foo' ,
149- 'bar' ,
150- false
151- ] ,
156+ [ `foo=${ path . join ( __dirname , 'fixtures' , 'secret.txt' ) . split ( path . sep ) . join ( path . posix . sep ) } ` , true , 'foo' , 'bar' , false ] ,
152157 [ `notfound=secret` , true , '' , '' , true ]
153158 ] ) ( 'given %p key and %p secret' , async ( kvp , file , exKey , exValue , invalid ) => {
154159 try {
0 commit comments