File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import fs from 'fs';
7
7
import cp from 'child_process' ;
8
8
import osm = require( 'os' ) ;
9
9
import path from 'path' ;
10
+ import each from 'jest-each' ;
10
11
import * as main from '../src/main' ;
11
12
import * as auth from '../src/authutil' ;
12
13
@@ -941,3 +942,21 @@ describe('setup-node', () => {
941
942
) ;
942
943
} ) ;
943
944
} ) ;
945
+
946
+ describe ( 'helper methods' , ( ) => {
947
+ describe ( 'parseNodeVersionFile' , ( ) => {
948
+ each `
949
+ contents | expected
950
+ ${ '12' } | ${ '12' }
951
+ ${ '12.3' } | ${ '12.3' }
952
+ ${ '12.3.4' } | ${ '12.3.4' }
953
+ ${ 'v12.3.4' } | ${ '12.3.4' }
954
+ ${ 'lts/erbium' } | ${ 'lts/erbium' }
955
+ ${ 'lts/*' } | ${ 'lts/*' }
956
+ ${ '' } | ${ '' }
957
+ ${ 'unknown format' } | ${ 'unknown format' }
958
+ ` . it ( 'parses "$contents"' , ( { contents, expected} ) => {
959
+ expect ( im . parseNodeVersionFile ( contents ) ) . toBe ( expected ) ;
960
+ } ) ;
961
+ } ) ;
962
+ } ) ;
You can’t perform that action at this time.
0 commit comments