@@ -96,7 +96,7 @@ test('cli (conversions STL)', (t) => {
9696
9797 t . context . file3Path = file3Path
9898
99- cmd = `node ${ cliPath } ${ file2Path } -o ${ file3Path } -v -add-metadata false `
99+ cmd = `node ${ cliPath } ${ file2Path } -o ${ file3Path } -v -- add-metadata`
100100 execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
101101 t . true ( fs . existsSync ( file3Path ) )
102102} )
@@ -129,7 +129,7 @@ test('cli (conversions DXF)', (t) => {
129129
130130 t . context . file3Path = file3Path
131131
132- cmd = `node ${ cliPath } ${ file2Path } -of js`
132+ cmd = `node ${ cliPath } ${ file2Path } -f js`
133133 execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
134134 t . true ( fs . existsSync ( file3Path ) )
135135} )
@@ -162,7 +162,40 @@ test('cli (conversions JSON)', (t) => {
162162
163163 t . context . file3Path = file3Path
164164
165- cmd = `node ${ cliPath } ${ file2Path } -of js`
165+ cmd = `node ${ cliPath } ${ file2Path } -f js`
166+ execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
167+ t . true ( fs . existsSync ( file3Path ) )
168+ } )
169+
170+ test ( 'cli (conversions OBJ)' , ( t ) => {
171+ const testID = 17
172+
173+ // convert from JSCAD to OBJ
174+ const file1Path = createJscad ( testID )
175+ t . true ( fs . existsSync ( file1Path ) )
176+
177+ t . context . file1Path = file1Path
178+
179+ const file2Name = `./test${ testID } .obj`
180+ const file2Path = path . resolve ( cwd ( ) , file2Name )
181+ t . false ( fs . existsSync ( file2Path ) )
182+
183+ t . context . file2Path = file2Path
184+
185+ const cliPath = t . context . cliPath
186+
187+ let cmd = `node ${ cliPath } ${ file1Path } -o ${ file2Path } `
188+ execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
189+ t . true ( fs . existsSync ( file2Path ) )
190+
191+ // convert from OBJ to JS
192+ const file3Name = `./test${ testID } .js`
193+ const file3Path = path . resolve ( cwd ( ) , file3Name )
194+ t . false ( fs . existsSync ( file3Path ) )
195+
196+ t . context . file3Path = file3Path
197+
198+ cmd = `node ${ cliPath } ${ file2Path } -f js`
166199 execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
167200 t . true ( fs . existsSync ( file3Path ) )
168201} )
@@ -195,7 +228,7 @@ test('cli (conversions SVG)', (t) => {
195228
196229 t . context . file3Path = file3Path
197230
198- cmd = `node ${ cliPath } ${ file2Path } -of js`
231+ cmd = `node ${ cliPath } ${ file2Path } -f js`
199232 execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
200233 t . true ( fs . existsSync ( file3Path ) )
201234} )
@@ -228,7 +261,40 @@ test('cli (conversions X3D)', (t) => {
228261
229262 t . context . file3Path = file3Path
230263
231- cmd = `node ${ cliPath } ${ file2Path } -of js`
264+ cmd = `node ${ cliPath } ${ file2Path } -f js`
265+ execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
266+ t . true ( fs . existsSync ( file3Path ) )
267+ } )
268+
269+ test ( 'cli (conversions 3MF)' , ( t ) => {
270+ const testID = 16
271+
272+ // convert from JSCAD to 3MF
273+ const file1Path = createJscad ( testID )
274+ t . true ( fs . existsSync ( file1Path ) )
275+
276+ t . context . file1Path = file1Path
277+
278+ const file2Name = `./test${ testID } .3mf`
279+ const file2Path = path . resolve ( cwd ( ) , file2Name )
280+ t . false ( fs . existsSync ( file2Path ) )
281+
282+ t . context . file2Path = file2Path
283+
284+ const cliPath = t . context . cliPath
285+
286+ let cmd = `node ${ cliPath } ${ file1Path } -o ${ file2Path } `
287+ execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
288+ t . true ( fs . existsSync ( file2Path ) )
289+
290+ // convert from 3MF to JS
291+ const file3Name = `./test${ testID } .js`
292+ const file3Path = path . resolve ( cwd ( ) , file3Name )
293+ t . false ( fs . existsSync ( file3Path ) )
294+
295+ t . context . file3Path = file3Path
296+
297+ cmd = `node ${ cliPath } ${ file2Path } -f js`
232298 execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } )
233299 t . true ( fs . existsSync ( file3Path ) )
234300} )
0 commit comments