Skip to content

Commit 9b2a186

Browse files
committed
Merge branch 'dev'
2 parents f564d58 + f0da7f0 commit 9b2a186

File tree

1 file changed

+36
-52
lines changed

1 file changed

+36
-52
lines changed

test/index.js

Lines changed: 36 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,9 @@ describe('G-code Toolpath', () => {
162162
}
163163
});
164164

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();
169168
});
170169

171170
});
@@ -192,10 +191,8 @@ describe('G-code Toolpath', () => {
192191
}
193192
});
194193

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();
199196
});
200197

201198
it('should generate tool paths for helical thread milling.', (done) => {
@@ -219,10 +216,8 @@ describe('G-code Toolpath', () => {
219216
}
220217
});
221218

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();
226221
});
227222

228223
it('should generate for one inch circle.', (done) => {
@@ -246,10 +241,8 @@ describe('G-code Toolpath', () => {
246241
}
247242
});
248243

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();
253246
});
254247

255248
});
@@ -274,10 +267,9 @@ describe('G-code Toolpath', () => {
274267
});
275268
}
276269
});
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();
281273
});
282274
});
283275

@@ -325,10 +317,9 @@ describe('G-code Toolpath', () => {
325317
});
326318
}
327319
});
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();
332323
});
333324
});
334325

@@ -348,10 +339,9 @@ describe('G-code Toolpath', () => {
348339
});
349340
}
350341
});
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();
355345
});
356346

357347
it('should generate correct tool paths in the XY-plane (G17)', (done) => {
@@ -398,10 +388,9 @@ describe('G-code Toolpath', () => {
398388
});
399389
}
400390
});
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();
405394
});
406395

407396
it('should generate correct tool paths in the ZX-plane (G18)', (done) => {
@@ -448,10 +437,9 @@ describe('G-code Toolpath', () => {
448437
});
449438
}
450439
});
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();
455443
});
456444

457445
it('should generate correct tool paths in the YZ-plane (G19)', (done) => {
@@ -498,10 +486,9 @@ describe('G-code Toolpath', () => {
498486
});
499487
}
500488
});
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();
505492
});
506493

507494
});
@@ -526,10 +513,9 @@ describe('G-code Toolpath', () => {
526513
});
527514
}
528515
});
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();
533519
});
534520
});
535521

@@ -553,10 +539,9 @@ describe('G-code Toolpath', () => {
553539
});
554540
}
555541
});
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();
560545
});
561546
});
562547

@@ -580,10 +565,9 @@ describe('G-code Toolpath', () => {
580565
});
581566
}
582567
});
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();
587571
});
588572
});
589573

0 commit comments

Comments
 (0)