1
1
const getCmd = require ( './get.cmd' ) . toCommand ( ) ;
2
+ const yargs = require ( 'yargs' ) ;
2
3
3
4
let annotateCmd = require ( './annotate.cmd' ) ;
4
5
let tagCmd = require ( './tag.cmd' ) ;
@@ -15,11 +16,9 @@ untagCmd = untagCmd.toCommand();
15
16
16
17
jest . mock ( '../../../../logic/entities/Image' ) ;
17
18
18
- jest . mock ( '../../helpers/image' , ( ) => {
19
- return {
20
- extractImages : images => images ,
21
- } ;
22
- } ) ;
19
+ jest . mock ( '../../helpers/image' , ( ) => ( {
20
+ extractImages : images => images ,
21
+ } ) ) ;
23
22
24
23
const request = require ( 'requestretry' ) ;
25
24
@@ -32,6 +31,27 @@ describe('image commands', () => {
32
31
await configureSdk ( ) ; // eslint-disable-line
33
32
} ) ;
34
33
34
+ describe ( 'stop parse number' , ( ) => {
35
+ it ( 'should be string' , async ( ) => {
36
+ const { numberArg } = yargs ( [ '--numberArg' , '21' ] )
37
+ . parserConfiguration ( {
38
+ 'parse-numbers' : false ,
39
+ } )
40
+ . option ( 'numberArg' , { } )
41
+ . argv ;
42
+
43
+ expect ( typeof numberArg ) . toBe ( 'string' ) ;
44
+ } ) ;
45
+
46
+ it ( 'should be number' , async ( ) => {
47
+ const { numberArg } = yargs ( [ '--numberArg' , '21' ] )
48
+ . option ( 'numberArg' , { } )
49
+ . argv ;
50
+
51
+ expect ( typeof numberArg ) . toBe ( 'number' ) ;
52
+ } ) ;
53
+ } ) ;
54
+
35
55
describe ( 'get' , ( ) => {
36
56
it ( 'should handle getting given id' , async ( ) => {
37
57
const argv = { id : [ 'some id' ] , label : [ ] , tag : [ ] } ;
0 commit comments