@@ -18,6 +18,8 @@ const setup = async (t, file, {
1818 tdir = path . join ( tdir , dir )
1919 }
2020
21+ inputs = Array . isArray ( inputs ) ? inputs : validInput ( inputs )
22+
2123 const args = [ file , CHILD , tdir , inputFile ]
2224 if ( config ) {
2325 args . push ( JSON . stringify ( config ) )
@@ -75,4 +77,27 @@ async function child ({ chdir } = {}) {
7577 }
7678}
7779
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+
78103module . exports = { setup, child, isChild, getFixture }
0 commit comments