mirror of
https://github.com/TECHNOFAB11/ergogen.git
synced 2025-12-12 08:00:06 +01:00
Outsource kicad outline conversion to pcb templates
This commit is contained in:
parent
6079aaf332
commit
de7441d632
6 changed files with 57 additions and 46 deletions
BIN
test/fixtures/bundle.zip
vendored
BIN
test/fixtures/bundle.zip
vendored
Binary file not shown.
|
|
@ -1,3 +1,6 @@
|
|||
module.exports = params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
module.exports = {
|
||||
convert_outline: () => {},
|
||||
body: params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
}
|
||||
}
|
||||
|
|
@ -140,7 +140,10 @@ exports.inject = (ergogen) => {
|
|||
}
|
||||
})
|
||||
|
||||
ergogen.inject('template', 'template_test', params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
ergogen.inject('template', 'template_test', {
|
||||
convert_outline: () => {},
|
||||
body: params => {
|
||||
return `Custom template override. The secret is ${params.custom.secret}.`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
const m = require('makerjs')
|
||||
const pcb_lib = require('../../src/pcbs')
|
||||
const kicad5 = require('../../src/templates/kicad5')
|
||||
const ergogen = require('../../src/ergogen')
|
||||
|
||||
describe('Internals', function() {
|
||||
|
||||
it('makerjs2kicad', function() {
|
||||
it('pcb outline conversion', 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")
|
||||
kicad5.convert_outline.bind(this).should.throw("Can't convert path type")
|
||||
})
|
||||
|
||||
it('injection', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue