diff --git a/setup.js b/setup.js index d724cec..fcecf93 100644 --- a/setup.js +++ b/setup.js @@ -5,11 +5,18 @@ if(!window.WOTLK_TO_RETAIL_DISPLAY_ID_API){ window.WOTLK_TO_RETAIL_DISPLAY_ID_API=`https://wotlk.murlocvillage.com/api/items` } +class WebP { + getImageExtension() { + return `.webp` + } + +} if (!window.WH) { window.WH = {} window.WH.debug = function (...args) { console.log(args) } window.WH.defaultAnimation = `Stand` + window.WH.WebP = new WebP() window.WH.Wow = { Item: { INVENTORY_TYPE_HEAD: 1, diff --git a/tests/setup.test.js b/tests/setup.test.js index 8aff1ba..60288ab 100644 --- a/tests/setup.test.js +++ b/tests/setup.test.js @@ -8,7 +8,12 @@ describe(`WH`, () => { expect(window.WOTLK_TO_RETAIL_DISPLAY_ID_API).toEqual(`https://wotlk.murlocvillage.com/api/items`) expect(window.CONTENT_PATH).toEqual(`http://localhost:3001/modelviewer/live/`) }) - it(`check consts WH.debug`, async () => { + + it(`check function WH.debug`, async () => { WH.debug(`Hello`, `world`) }) -}) \ No newline at end of file + + it(`check method WH.WebP.getImageExtension`, async () => { + expect(expect(WH.WebP.getImageExtension()).toEqual(`.webp`)) + }) +})