2022-09-14 15:04:24 +02:00
|
|
|
import chai from 'chai'
|
|
|
|
import * as all from './dist/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) {
|
2022-08-29 13:28:46 +02:00
|
|
|
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
|
|
|
}
|