diff --git a/modules/1plusXRtdProvider.js b/modules/1plusXRtdProvider.js index cc3ca0727f1..dc833c46a37 100644 --- a/modules/1plusXRtdProvider.js +++ b/modules/1plusXRtdProvider.js @@ -1,22 +1,25 @@ -import { submodule } from "../src/hook" +import { submodule } from '../src/hook.js' +import { logMessage } from '../src/utils.js'; + // Constants const REAL_TIME_MODULE = 'realTimeData' const MODULE_NAME = '1plusX' // Functions -const getBidRequestDataAsync = async (reqBidsConfigObj, config, userConsent) => { +const getBidRequestDataAsync = (reqBidsConfigObj, config, userConsent) => { + // We don't // Maybe treat the case where we already have the audiences & segments in local storage // Get the required config // Call PAPI // -- Then : // ---- extract relevant data // ---- set the data to the bid - // -- Catch : print err & do nothing + // -- Catch : print err & do nothing } // Functions exported in submodule object const init = (config, userConsent) => { - // We prolly get the config again in getBidRequestData + // We prolly get the config again in getBidRequestData return true; } @@ -24,7 +27,7 @@ const getBidRequestData = (reqBidsConfigObj, callback, config, userConsent) => { getBidRequestDataAsync(reqBidsConfigObj, config, userConsent) .then(() => callback()) .catch((err) => { - console.error(err); + logMessage(err); callback(); }) } @@ -37,4 +40,4 @@ export const onePlusXSubmodule = { } // Register the onePlusXSubmodule as submodule of realTimeData -submodule(REAL_TIME_MODULE, MODULE_NAME); \ No newline at end of file +submodule(REAL_TIME_MODULE, MODULE_NAME); diff --git a/test/spec/modules/1plusXRtdProvider_spec.js b/test/spec/modules/1plusXRtdProvider_spec.js new file mode 100644 index 00000000000..16b711b9523 --- /dev/null +++ b/test/spec/modules/1plusXRtdProvider_spec.js @@ -0,0 +1,17 @@ +import { config } from 'src/config'; +import { onePlusXSubmodule } from 'modules/1plusXRtdProvider'; + +describe('1plusXRtdProvider', () => { + before(() => { + config.resetConfig(); + }) + + after(() => { }) + + describe('onePlusXSubmodule', () => { + it('init is successfull', () => { + const initResult = onePlusXSubmodule.init(); + expect(initResult).to.be.true; + }) + }) +})