1
0
Fork 0
freesewing/packages/core/tests/hooks.test.mjs
Joost De Cock 0cbffd6dc6 wip(core): Work on late-stage config resolver
This moves resolving of the config from the pattern constructor to the
init() method. The idea is that adding a part to a pattern is exactly
the same as adding a part to a design. In other words, late-stage adding
of parts would be no different as the config gets resolved after that.

This is currently broken in many different ways, but the unit tests
particular to this new way of resolving the config do pass.
2022-09-09 20:20:38 +02:00

22 lines
456 B
JavaScript

import chai from 'chai'
import { Pattern } from '../src/index.mjs'
const expect = chai.expect
describe('Hooks', () => {
it('Should contain all hooks', () => {
const pattern = new Pattern()
const h = pattern.hooks
const test = {
preDraft: [],
postDraft: [],
postLayout: [],
preSample: [],
postSample: [],
preRender: [],
postRender: [],
insertText: [],
}
expect(h).to.eql(test)
})
})