Getting coverage to 100%

This commit is contained in:
Bán Dénes 2023-01-23 23:34:06 +01:00
parent b27e10374e
commit c45523f38a
25 changed files with 2393 additions and 2282 deletions

22
test/unit/internals.js Normal file
View file

@ -0,0 +1,22 @@
const m = require('makerjs')
const pcb_lib = require('../../src/pcbs')
const ergogen = require('../../src/ergogen')
describe('Internals', function() {
it('makerjs2kicad', function() {
// warn on unknown path type
sinon.stub(m.model, 'walk').callsFake(function(model, config) {
config.onPath({pathContext: {type: 'nonexistent'}})
})
pcb_lib._makerjs2kicad.bind(this).should.throw("Can't convert path type")
})
it('injection', function() {
// warn on unknown injection type
ergogen.inject.bind(this, 'nonexistent', 'name', 'value').should.throw('Unknown injection type')
})
})