import { describe, it } from "mocha"; import { expect } from "chai"; import { getFormatFromId, Format, smallBannerFormats, mpuFormats, interstitialFormats, } from "../../../src/utils/format"; describe("format util", function () { smallBannerFormats.forEach((data) => { it(`get small banner format ${data} `, function () { const result = getFormatFromId(data); expect(result).to.be.equal(Format.SBA); }); }); mpuFormats.forEach((data) => { it(`get mpu format ${data} `, function () { const result = getFormatFromId(data); expect(result).to.be.equal(Format.MPU); }); }); interstitialFormats.forEach((data) => { it(`get interstitial format ${data} `, function () { const result = getFormatFromId(data); expect(result).to.be.equal(Format.INT); }); }); ["-1", undefined, null].forEach((data) => { it(`get default format ${data} `, function () { const result = getFormatFromId(data); expect(result).to.be.equal(Format.DEFAULT); }); }); });