
Note that the tests for Lumina are failing, but that's not related to the chai upgrade, rather it seems these tests fail because of issues in the design that we'll tackle later (it's a brand new design yet to be released).
36 lines
936 B
JavaScript
36 lines
936 B
JavaScript
import { expect } from 'chai'
|
|
import { Defs } from '../src/defs.mjs'
|
|
|
|
describe('Defs', () => {
|
|
let defs = new Defs()
|
|
|
|
it('Should set a def', () => {
|
|
defs.set('test', 'passed')
|
|
expect(defs.get('test')).to.equal('passed')
|
|
})
|
|
|
|
it('Should remove a def', () => {
|
|
defs.remove('test')
|
|
expect(defs.get('test')).to.equal(false)
|
|
})
|
|
|
|
it('Should only set an unset def', () => {
|
|
defs.setIfUnset('test', 'passed')
|
|
expect(defs.get('test')).to.equal('passed')
|
|
defs.setIfUnset('test', 'failed')
|
|
expect(defs.get('test')).to.equal('passed')
|
|
})
|
|
|
|
it('Should return false when getting an unset def', () => {
|
|
expect(defs.get('doNotTest')).to.equal(false)
|
|
})
|
|
|
|
it('Should render defs correctly', () => {
|
|
console.log(defs.render())
|
|
expect(defs.render()).to.equal(' test="passed"')
|
|
})
|
|
|
|
it('Should be able to clone itself', () => {
|
|
expect(defs.clone().get('test')).to.equal('passed')
|
|
})
|
|
})
|