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

28 lines
737 B
JavaScript
Raw Normal View History

2022-08-28 19:51:15 +02:00
import chai from "chai"
import * as all from "./dist/index.mjs"
const expect = chai.expect
const { measurements, sizes } = all
describe('Measurements', () => {
it("Measurements should be a named export and match the sizes", () => {
for (const m of measurements) {
2022-09-06 16:52:28 +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
}