• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prebid / Prebid.js / 16809528788

07 Aug 2025 03:57PM UTC coverage: 96.254%. Remained the same
16809528788

push

github

web-flow
Risemediatech Bid Adapter : New Bidder Adapter (#13600)

* RM-845 : Initial implementation for risemediatech bid adapter

* RM-845 : Added bidder parameter documentation for risemediatech Bid Adapter

* RM-845 : minor modifications

* RM-845 : Handled es lint errors

* RM-847 : Unit Test for Risemediatech Bid Adapter

* Updated unit tests

* Modified the bid adapter code and unit tests

* Modified prebid js code to remove validations and also added bidfloor to the request.

* added the vastxml field in the response for the video media type

* Fixed incorrect media type issue

* Added test mode impressions support

* Added test mode for video ad units

* Added bidfloor for example video ad unit

* Updated default TTL

* Minro fixes

* Update docs

* Minor changes

* Minor changes

* Code cleanup

* Changes as per review

* Semantic changes

* Added support for Http Status 204 No Bids Scenarios

* Updated failing unit tests.

* Modified the check for no bids

* Reverted the status check

* linter modifications

* Updated the documentation for the adapter and formatted adapter

* Modified the documentation as per discussion

* Resolved linter errors from upstream repo PR

39576 of 48646 branches covered (81.36%)

237 of 244 new or added lines in 2 files covered. (97.13%)

148 existing lines in 17 files now uncovered.

195874 of 203497 relevant lines covered (96.25%)

123.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.48
/src/debugging.js
1
import {config} from './config.js';
2
import {getHook, hook} from './hook.js';
3
import {getGlobal} from './prebidGlobal.js';
4
import {logMessage, prefixLog} from './utils.js';
5
import {createBid} from './bidfactory.js';
6
import {loadExternalScript} from './adloader.js';
7
import {PbPromise} from './utils/promise.js';
8
import { MODULE_TYPE_PREBID } from './activities/modules.js';
9
import * as utils from './utils.js';
10
import {BANNER, NATIVE, VIDEO} from './mediaTypes.js';
11
import {Renderer} from './Renderer.js';
12

13
import {getDistUrlBase, getGlobalVarName} from './buildOptions.js';
14

15
export const DEBUG_KEY = `__${getGlobalVarName()}_debugging__`;
4✔
16

17
function isDebuggingInstalled() {
18
  return getGlobal().installedModules.includes('debugging');
1✔
19
}
20

21
function loadScript(url) {
UNCOV
22
  return new PbPromise((resolve) => {
×
UNCOV
23
    loadExternalScript(url, MODULE_TYPE_PREBID, 'debugging', resolve);
×
24
  });
25
}
26

27
export function debuggingModuleLoader({alreadyInstalled = isDebuggingInstalled, script = loadScript} = {}) {
8✔
28
  let loading = null;
8✔
29
  return function () {
8✔
30
    if (loading == null) {
6✔
31
      loading = new PbPromise((resolve, reject) => {
5✔
32
        // run this in a 0-delay timeout to give installedModules time to be populated
33
        setTimeout(() => {
5✔
34
          if (alreadyInstalled()) {
5✔
35
            resolve();
2✔
36
          } else {
37
            const url = `${getDistUrlBase()}debugging-standalone.js`;
3✔
38
            logMessage(`Debugging module not installed, loading it from "${url}"...`);
3✔
39
            getGlobal()._installDebugging = true;
3✔
40
            script(url).then(() => {
3✔
41
              getGlobal()._installDebugging({
2✔
42
                DEBUG_KEY,
43
                hook,
44
                config,
45
                createBid,
46
                logger: prefixLog('DEBUG:'),
47
                utils,
48
                BANNER,
49
                NATIVE,
50
                VIDEO,
51
                Renderer
52
              });
53
            }).then(resolve, reject);
54
          }
55
        });
56
      })
57
    }
58
    return loading;
6✔
59
  }
60
}
61

62
export function debuggingControls({load = debuggingModuleLoader(), hook = getHook('requestBids')} = {}) {
6✔
63
  let promise = null;
6✔
64
  let enabled = false;
6✔
65
  function waitForDebugging(next, ...args) {
2!
66
    return (promise || PbPromise.resolve()).then(() => next.apply(this, args))
1!
67
  }
68
  function enable() {
69
    if (!enabled) {
3✔
70
      promise = load();
3✔
71
      // set debugging to high priority so that it has the opportunity to mess with most things
72
      hook.before(waitForDebugging, 99);
3✔
73
      enabled = true;
3✔
74
    }
75
  }
76
  function disable() {
77
    hook.getHooks({hook: waitForDebugging}).remove();
10✔
78
    enabled = false;
10✔
79
  }
80
  function reset() {
81
    promise = null;
8✔
82
    disable();
8✔
83
  }
84
  return {enable, disable, reset};
6✔
85
}
86

87
const ctl = debuggingControls();
4✔
88
export const reset = ctl.reset;
4✔
89

90
export function loadSession() {
91
  let storage = null;
4✔
92
  try {
4✔
93
    // eslint-disable-next-line no-restricted-properties
94
    storage = window.sessionStorage;
4✔
95
  } catch (e) {}
96

97
  if (storage !== null) {
4✔
98
    const debugging = ctl;
4✔
99
    let config = null;
4✔
100
    try {
4✔
101
      config = storage.getItem(DEBUG_KEY);
4✔
102
    } catch (e) {}
103
    if (config !== null) {
4!
104
      // just make sure the module runs; it will take care of parsing the config (and disabling itself if necessary)
UNCOV
105
      debugging.enable();
×
106
    }
107
  }
108
}
109

110
config.getConfig('debugging', function ({debugging}) {
5✔
111
  debugging?.enabled ? ctl.enable() : ctl.disable();
2✔
112
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc