@@ -57,4 +57,68 @@ describe('filter', () => {
57
57
upgraded . should . have . property ( 'lodash' )
58
58
} )
59
59
60
+ it ( 'filter with regex string' , async ( ) => {
61
+ const upgraded = await ncu . run ( {
62
+ packageData : JSON . stringify ( {
63
+ dependencies : {
64
+ lodash : '2.0.0' ,
65
+ 'lodash.map' : '2.0.0' ,
66
+ 'lodash.filter' : '2.0.0'
67
+ }
68
+ } ) ,
69
+ filter : '/lodash\\..*/'
70
+ } )
71
+ upgraded . should . have . property ( 'lodash.map' )
72
+ upgraded . should . have . property ( 'lodash.filter' )
73
+ } )
74
+
75
+ it ( 'filter with array of strings' , async ( ) => {
76
+ const upgraded = await ncu . run ( {
77
+ packageData : JSON . stringify ( {
78
+ dependencies : {
79
+ lodash : '2.0.0' ,
80
+ 'lodash.map' : '2.0.0' ,
81
+ 'lodash.filter' : '2.0.0'
82
+ }
83
+ } ) ,
84
+ filter : [ 'lodash.map' , 'lodash.filter' ]
85
+ } )
86
+ upgraded . should . have . property ( 'lodash.map' )
87
+ upgraded . should . have . property ( 'lodash.filter' )
88
+ } )
89
+
90
+ it ( 'filter with array of regex' , async ( ) => {
91
+ const upgraded = await ncu . run ( {
92
+ packageData : JSON . stringify ( {
93
+ dependencies : {
94
+ 'fp-and-or' : '0.1.0' ,
95
+ lodash : '2.0.0' ,
96
+ 'lodash.map' : '2.0.0' ,
97
+ 'lodash.filter' : '2.0.0'
98
+ }
99
+ } ) ,
100
+ filter : [ / l o d a s h \. .* / , / f p .* / ]
101
+ } )
102
+ upgraded . should . have . property ( 'lodash.map' )
103
+ upgraded . should . have . property ( 'lodash.filter' )
104
+ upgraded . should . have . property ( 'fp-and-or' )
105
+ } )
106
+
107
+ it ( 'filter with array of regex strings' , async ( ) => {
108
+ const upgraded = await ncu . run ( {
109
+ packageData : JSON . stringify ( {
110
+ dependencies : {
111
+ 'fp-and-or' : '0.1.0' ,
112
+ lodash : '2.0.0' ,
113
+ 'lodash.map' : '2.0.0' ,
114
+ 'lodash.filter' : '2.0.0'
115
+ }
116
+ } ) ,
117
+ filter : [ '/lodash\\..*/' , '/fp.*/' ]
118
+ } )
119
+ upgraded . should . have . property ( 'lodash.map' )
120
+ upgraded . should . have . property ( 'lodash.filter' )
121
+ upgraded . should . have . property ( 'fp-and-or' )
122
+ } )
123
+
60
124
} )
0 commit comments