mirror of
https://github.com/TECHNOFAB11/ergogen.git
synced 2025-12-13 16:40:05 +01:00
Add unit test for assertions
This commit is contained in:
parent
c7b86c7556
commit
9baae154cb
7 changed files with 94 additions and 17 deletions
|
|
@ -148,7 +148,7 @@ const footprint = exports._footprint = (config, name, points, point, net_indexer
|
|||
if (config === false) return ''
|
||||
|
||||
// config sanitization
|
||||
a.detect_unexpected(config, name, ['type', 'anchor', 'nets', 'params'])
|
||||
a.unexpected(config, name, ['type', 'anchor', 'nets', 'params'])
|
||||
const type = a.in(config.type, `${name}.type`, Object.keys(footprint_types))
|
||||
let anchor = make_anchor(config.anchor || {}, `${name}.anchor`, points, true, point)(units)
|
||||
const nets = a.sane(config.nets || {}, `${name}.nets`, 'object')()
|
||||
|
|
@ -210,7 +210,7 @@ exports.parse = (config, points, outlines, units) => {
|
|||
for (const [pcb_name, pcb_config] of Object.entries(pcbs)) {
|
||||
|
||||
// config sanitization
|
||||
a.detect_unexpected(pcb_config, `pcbs.${pcb_name}`, ['outlines', 'footprints'])
|
||||
a.unexpected(pcb_config, `pcbs.${pcb_name}`, ['outlines', 'footprints'])
|
||||
|
||||
// outline conversion
|
||||
if (a.type(pcb_config.outlines)() == 'array') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue