1
1
import { PathLike } from 'fs' ;
2
- import createConfig from './app' ;
2
+ import createConfig , { gatherVersions } from './app' ;
3
3
4
4
describe ( 'config/app' , ( ) => {
5
+ describe ( 'gatherVersions()' , ( ) => {
6
+ test . each `
7
+ constraint | expected
8
+ ${ '7.0' } | ${ [ '7.0' ] }
9
+ ${ '^7.0' } | ${ [ '7.0' , '7.1' , '7.2' , '7.3' , '7.4' ] }
10
+ ${ '8.1' } | ${ [ '8.1' ] }
11
+ ${ '8.1.0' } | ${ [ '8.1' ] }
12
+ ${ '8.1.12' } | ${ [ '8.1' ] }
13
+ ${ '^8.1' } | ${ [ '8.1' , '8.2' ] }
14
+ ${ '^8.1.0' } | ${ [ '8.1' , '8.2' ] }
15
+ ${ '^8.1.12' } | ${ [ '8.1' , '8.2' ] }
16
+ ${ '~8.1' } | ${ [ '8.1' ] }
17
+ ${ '~8.1.0' } | ${ [ '8.1' ] }
18
+ ${ '~8.1.12' } | ${ [ '8.1' ] }
19
+ ${ '^7.4 || ~8.0.0 || ~8.1.12' } | ${ [ '7.4' , '8.0' , '8.1' ] }
20
+ ` ( 'gatherVersions() for "$constraint" === $expected' , ( { constraint, expected} ) => {
21
+ expect ( gatherVersions ( { require : { php : constraint } } ) ) . toEqual ( expected ) ;
22
+ } ) ;
23
+ } ) ;
24
+
5
25
describe ( 'createConfig()' , ( ) => {
6
26
const phpIniFromConfigurationPath : PathLike = 'tests/php-ini-from-configuration' ;
7
27
@@ -18,7 +38,7 @@ describe('config/app', () => {
18
38
codeChecks : true ,
19
39
docLinting : true ,
20
40
versions : [ '8.1' ] ,
21
- stablePhpVersion : '8.1 ' ,
41
+ stablePhpVersion : '7.4 ' ,
22
42
minimumPhpVersion : '8.1' ,
23
43
latestPhpVersion : '8.1' ,
24
44
lockedDependenciesExists : false ,
0 commit comments