1
0
Fork 0

wip(core): Work on part unit tests

This commit is contained in:
joostdecock 2022-09-10 16:00:43 +02:00
parent 904e0044c5
commit cf0c70f4c6
4 changed files with 165 additions and 320 deletions

View file

@ -646,7 +646,26 @@ describe('Pattern', () => {
const pattern = new Pattern()
const part = pattern.__createPartWithContext('test')
expect(typeof part.context).to.equal('object')
expect(typeof part.context.parts).to.equal('object')
expect(typeof part.context.config).to.equal('object')
expect(typeof part.context.config.options).to.equal('object')
expect(typeof part.context.config.data).to.equal('object')
expect(Array.isArray(part.context.config.measurements)).to.equal(true)
expect(Array.isArray(part.context.config.optionalMeasurements)).to.equal(true)
expect(Array.isArray(part.context.config.parts)).to.equal(true)
expect(Array.isArray(part.context.config.plugins)).to.equal(true)
expect(part.context.settings).to.equal(pattern.settings)
expect(typeof part.context.store).to.equal('object')
expect(typeof part.context.store.log).to.equal('object')
expect(typeof part.context.store.log.debug).to.equal('function')
expect(typeof part.context.store.log.info).to.equal('function')
expect(typeof part.context.store.log.warning).to.equal('function')
expect(typeof part.context.store.log.error).to.equal('function')
expect(typeof part.context.store.logs).to.equal('object')
expect(Array.isArray(part.context.store.logs.debug)).to.equal(true)
expect(Array.isArray(part.context.store.logs.info)).to.equal(true)
expect(Array.isArray(part.context.store.logs.warning)).to.equal(true)
expect(Array.isArray(part.context.store.logs.error)).to.equal(true)
})
})