@@ -162,10 +162,9 @@ describe('G-code Toolpath', () => {
162
162
}
163
163
} ) ;
164
164
165
- toolpath . loadFromFile ( 'test/fixtures/linear.nc' , ( err , results ) => {
166
- expect ( motions ) . to . deep . equal ( expectedMotions ) ;
167
- done ( ) ;
168
- } ) ;
165
+ toolpath . loadFromFileSync ( 'test/fixtures/linear.nc' ) ;
166
+ expect ( motions ) . to . deep . equal ( expectedMotions ) ;
167
+ done ( ) ;
169
168
} ) ;
170
169
171
170
} ) ;
@@ -192,10 +191,8 @@ describe('G-code Toolpath', () => {
192
191
}
193
192
} ) ;
194
193
195
- toolpath . loadFromFile ( 'test/fixtures/arc-r.nc' , ( err , results ) => {
196
- // TODO: Add test case
197
- done ( ) ;
198
- } ) ;
194
+ toolpath . loadFromFileSync ( 'test/fixtures/arc-r.nc' ) ;
195
+ done ( ) ;
199
196
} ) ;
200
197
201
198
it ( 'should generate tool paths for helical thread milling.' , ( done ) => {
@@ -219,10 +216,8 @@ describe('G-code Toolpath', () => {
219
216
}
220
217
} ) ;
221
218
222
- toolpath . loadFromFile ( 'test/fixtures/helical-thread-milling.nc' , ( err , results ) => {
223
- // TODO: Add test case
224
- done ( ) ;
225
- } ) ;
219
+ toolpath . loadFromFileSync ( 'test/fixtures/helical-thread-milling.nc' ) ;
220
+ done ( ) ;
226
221
} ) ;
227
222
228
223
it ( 'should generate for one inch circle.' , ( done ) => {
@@ -246,10 +241,8 @@ describe('G-code Toolpath', () => {
246
241
}
247
242
} ) ;
248
243
249
- toolpath . loadFromFile ( 'test/fixtures/one-inch-circle.nc' , ( err , results ) => {
250
- // TODO: Add test case
251
- done ( ) ;
252
- } ) ;
244
+ toolpath . loadFromFileSync ( 'test/fixtures/one-inch-circle.nc' ) ;
245
+ done ( ) ;
253
246
} ) ;
254
247
255
248
} ) ;
@@ -274,10 +267,9 @@ describe('G-code Toolpath', () => {
274
267
} ) ;
275
268
}
276
269
} ) ;
277
- toolpath . loadFromFile ( 'test/fixtures/dwell.nc' , ( err , results ) => {
278
- expect ( motions ) . to . be . empty ;
279
- done ( ) ;
280
- } ) ;
270
+ toolpath . loadFromFileSync ( 'test/fixtures/dwell.nc' ) ;
271
+ expect ( motions ) . to . be . empty ;
272
+ done ( ) ;
281
273
} ) ;
282
274
} ) ;
283
275
@@ -325,10 +317,9 @@ describe('G-code Toolpath', () => {
325
317
} ) ;
326
318
}
327
319
} ) ;
328
- toolpath . loadFromFile ( 'test/fixtures/motion.nc' , ( err , results ) => {
329
- expect ( motions ) . to . deep . equal ( expectedmotions ) ;
330
- done ( ) ;
331
- } ) ;
320
+ toolpath . loadFromFileSync ( 'test/fixtures/motion.nc' ) ;
321
+ expect ( motions ) . to . deep . equal ( expectedmotions ) ;
322
+ done ( ) ;
332
323
} ) ;
333
324
} ) ;
334
325
@@ -348,10 +339,9 @@ describe('G-code Toolpath', () => {
348
339
} ) ;
349
340
}
350
341
} ) ;
351
- toolpath . loadFromFile ( 'test/fixtures/arc-no-plane.nc' , ( err , results ) => {
352
- expect ( motions ) . to . be . empty ;
353
- done ( ) ;
354
- } ) ;
342
+ toolpath . loadFromFileSync ( 'test/fixtures/arc-no-plane.nc' ) ;
343
+ expect ( motions ) . to . be . empty ;
344
+ done ( ) ;
355
345
} ) ;
356
346
357
347
it ( 'should generate correct tool paths in the XY-plane (G17)' , ( done ) => {
@@ -398,10 +388,9 @@ describe('G-code Toolpath', () => {
398
388
} ) ;
399
389
}
400
390
} ) ;
401
- toolpath . loadFromFile ( 'test/fixtures/arc-xy-plane.nc' , ( err , results ) => {
402
- expect ( motions ) . to . deep . equal ( expectedmotions ) ;
403
- done ( ) ;
404
- } ) ;
391
+ toolpath . loadFromFileSync ( 'test/fixtures/arc-xy-plane.nc' ) ;
392
+ expect ( motions ) . to . deep . equal ( expectedmotions ) ;
393
+ done ( ) ;
405
394
} ) ;
406
395
407
396
it ( 'should generate correct tool paths in the ZX-plane (G18)' , ( done ) => {
@@ -448,10 +437,9 @@ describe('G-code Toolpath', () => {
448
437
} ) ;
449
438
}
450
439
} ) ;
451
- toolpath . loadFromFile ( 'test/fixtures/arc-zx-plane.nc' , ( err , results ) => {
452
- expect ( motions ) . to . deep . equal ( expectedmotions ) ;
453
- done ( ) ;
454
- } ) ;
440
+ toolpath . loadFromFileSync ( 'test/fixtures/arc-zx-plane.nc' ) ;
441
+ expect ( motions ) . to . deep . equal ( expectedmotions ) ;
442
+ done ( ) ;
455
443
} ) ;
456
444
457
445
it ( 'should generate correct tool paths in the YZ-plane (G19)' , ( done ) => {
@@ -498,10 +486,9 @@ describe('G-code Toolpath', () => {
498
486
} ) ;
499
487
}
500
488
} ) ;
501
- toolpath . loadFromFile ( 'test/fixtures/arc-yz-plane.nc' , ( err , results ) => {
502
- expect ( motions ) . to . deep . equal ( expectedmotions ) ;
503
- done ( ) ;
504
- } ) ;
489
+ toolpath . loadFromFileSync ( 'test/fixtures/arc-yz-plane.nc' ) ;
490
+ expect ( motions ) . to . deep . equal ( expectedmotions ) ;
491
+ done ( ) ;
505
492
} ) ;
506
493
507
494
} ) ;
@@ -526,10 +513,9 @@ describe('G-code Toolpath', () => {
526
513
} ) ;
527
514
}
528
515
} ) ;
529
- toolpath . loadFromFile ( 'test/fixtures/units.nc' , ( err , results ) => {
530
- expect ( motions ) . to . be . empty ;
531
- done ( ) ;
532
- } ) ;
516
+ toolpath . loadFromFileSync ( 'test/fixtures/units.nc' ) ;
517
+ expect ( motions ) . to . be . empty ;
518
+ done ( ) ;
533
519
} ) ;
534
520
} ) ;
535
521
@@ -553,10 +539,9 @@ describe('G-code Toolpath', () => {
553
539
} ) ;
554
540
}
555
541
} ) ;
556
- toolpath . loadFromFile ( 'test/fixtures/coordinate.nc' , ( err , results ) => {
557
- expect ( motions ) . to . be . empty ;
558
- done ( ) ;
559
- } ) ;
542
+ toolpath . loadFromFileSync ( 'test/fixtures/coordinate.nc' ) ;
543
+ expect ( motions ) . to . be . empty ;
544
+ done ( ) ;
560
545
} ) ;
561
546
} ) ;
562
547
@@ -580,10 +565,9 @@ describe('G-code Toolpath', () => {
580
565
} ) ;
581
566
}
582
567
} ) ;
583
- toolpath . loadFromFile ( 'test/fixtures/feedrate.nc' , ( err , results ) => {
584
- expect ( motions ) . to . be . empty ;
585
- done ( ) ;
586
- } ) ;
568
+ toolpath . loadFromFileSync ( 'test/fixtures/feedrate.nc' ) ;
569
+ expect ( motions ) . to . be . empty ;
570
+ done ( ) ;
587
571
} ) ;
588
572
} ) ;
589
573
0 commit comments