@@ -18,6 +18,8 @@ const setup = async (t, file, {
18
18
tdir = path . join ( tdir , dir )
19
19
}
20
20
21
+ inputs = Array . isArray ( inputs ) ? inputs : validInput ( inputs )
22
+
21
23
const args = [ file , CHILD , tdir , inputFile ]
22
24
if ( config ) {
23
25
args . push ( JSON . stringify ( config ) )
@@ -75,4 +77,27 @@ async function child ({ chdir } = {}) {
75
77
}
76
78
}
77
79
80
+ const standardValue = ( value ) => {
81
+ if ( Array . isArray ( value ) && Array . isArray ( value [ 0 ] ) ) {
82
+ return value
83
+ }
84
+ return [ value ]
85
+ }
86
+
87
+ const validInput = ( obj ) => {
88
+ return [
89
+ ...standardValue ( obj . name || '' ) ,
90
+ ...standardValue ( obj . version || '' ) ,
91
+ ...standardValue ( obj . description || '' ) ,
92
+ ...standardValue ( obj . entry || '' ) ,
93
+ ...standardValue ( obj . test || '' ) ,
94
+ ...standardValue ( obj . repo || '' ) ,
95
+ ...standardValue ( obj . keywords || '' ) ,
96
+ ...standardValue ( obj . author || '' ) ,
97
+ ...standardValue ( obj . licence || '' ) ,
98
+ ...standardValue ( obj . type || '' ) ,
99
+ ...standardValue ( obj . ok || 'yes' ) ,
100
+ ]
101
+ }
102
+
78
103
module . exports = { setup, child, isChild, getFixture }
0 commit comments