Skip to content

Commit

Permalink
add alias for google-ima3
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka committed Dec 21, 2022
1 parent 049012a commit 5e990c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/redirects/google-ima3.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,13 @@ export function GoogleIma3(source) {
hit(source);
}

GoogleIma3.names = ['google-ima3'];
GoogleIma3.names = [
'google-ima3',
// prefixed name
'ubo-google-ima.js',
// original ubo name
'google-ima.js',
];

GoogleIma3.injections = [
hit,
Expand Down
18 changes: 18 additions & 0 deletions tests/redirects/google-ima3.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ const afterEach = () => {

module(name, { beforeEach, afterEach });

test('Checking if alias name works', (assert) => {
const adgParams = {
name,
engine: 'test',
verbose: true,
};
const uboParams = {
name: 'ubo-google-ima.js',
engine: 'test',
verbose: true,
};

const codeByAdgParams = window.scriptlets.redirects.getCode(adgParams);
const codeByUboParams = window.scriptlets.redirects.getCode(uboParams);

assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok');
});

test('Ima mocked', (assert) => {
assert.expect(28);

Expand Down

0 comments on commit 5e990c4

Please sign in to comment.