1
0
Fork 0

fix(hi): Adapt to new rules about named exports

This commit is contained in:
Joost De Cock 2022-06-15 13:17:26 +02:00
parent 48922ad33a
commit 0bc65984cf
2 changed files with 56 additions and 11 deletions

View file

@ -12,16 +12,20 @@ import draftLowerTeeth from './lowerTeeth'
import draftUpperTeeth from './upperTeeth'
// Create design
const Pattern = new freesewing.Design(config, plugins)
const Hi = new freesewing.Design(config, plugins)
Pattern.prototype.draftBody = draftBody
Pattern.prototype.draftTail = draftTail
Pattern.prototype.draftMouth = draftMouth
Pattern.prototype.draftAboveMouth = draftAboveMouth
Pattern.prototype.draftBelly = draftBelly
Pattern.prototype.draftTopFin = draftTopFin
Pattern.prototype.draftBottomFin = draftBottomFin
Pattern.prototype.draftLowerTeeth = draftLowerTeeth
Pattern.prototype.draftUpperTeeth = draftUpperTeeth
Hi.prototype.draftBody = draftBody
Hi.prototype.draftTail = draftTail
Hi.prototype.draftMouth = draftMouth
Hi.prototype.draftAboveMouth = draftAboveMouth
Hi.prototype.draftBelly = draftBelly
Hi.prototype.draftTopFin = draftTopFin
Hi.prototype.draftBottomFin = draftBottomFin
Hi.prototype.draftLowerTeeth = draftLowerTeeth
Hi.prototype.draftUpperTeeth = draftUpperTeeth
export default Pattern
// Named exports
export { config, Hi }
// Default export
export default Hi

View file

@ -0,0 +1,41 @@
// This file is auto-generated.
// Changes you make will be overwritten.
import chai from 'chai'
import models from '@freesewing/models'
import patterns from '@freesewing/pattern-info'
import Hi from './dist/index.mjs'
// Shared tests
import { testPatternConfig } from '../../../tests/patterns/config.mjs'
import { testPatternDrafting } from '../../../tests/patterns/drafting.mjs'
import { testPatternSampling } from '../../../tests/patterns/sampling.mjs'
const expect = chai.expect
// Test config
testPatternConfig(
'hi',
new Hi(),
expect,
models,
patterns
)
// Test drafting
testPatternDrafting(
'hi',
Hi,
expect,
models,
patterns
)
// Test sampling
testPatternSampling(
'hi',
Hi,
expect,
models,
patterns
)