1
0
Fork 0
freesewing/packages/models/tests/models.test.mjs

27 lines
740 B
JavaScript
Raw Normal View History

import * as chai from 'chai'
import * as all from '../src/index.mjs'
2022-08-28 19:51:15 +02:00
const expect = chai.expect
const { measurements, sizes } = all
describe('Measurements', () => {
2022-09-14 15:04:24 +02:00
it('Measurements should be a named export and match the sizes', () => {
2022-08-28 19:51:15 +02:00
for (const m of measurements) {
2022-09-14 15:04:24 +02:00
expect(typeof all.cisFemaleAdult28[m]).to.equal('number')
2022-08-28 19:51:15 +02:00
}
})
})
for (const type in sizes) {
for (const size of sizes[type]) {
describe(`${type} size ${size}`, () => {
for (const m of measurements) {
it(`${type}${size} should have the ${m} measurement`, () => {
expect(typeof all[`${type}${size}`][m]).to.equal('number')
expect(isNaN(all[`${type}${size}`][m])).to.equal(false)
})
}
})
}
2022-08-28 19:51:15 +02:00
}