Skip to content

Commit

Permalink
Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Mar 26, 2024
1 parent d200317 commit 4cda1e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/scriptlets/prevent-fetch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,17 @@ if (!isSupported) {
const EXPECTED_RESPONSE_TYPE = 'cors';
const EXPECTED_RESPONSE_REDIRECTED = false;
const EXPECTED_RESPONSE_STATUS = 200;
const URL_PATH = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
const URL_PATH = '//127.0.0.1/pagead/js/adsbygoogle.js';
const inputRequest = new Request(URL_PATH);

runScriptlet(name, ['pagead2.googlesyndication.com', 'emptyStr']);
runScriptlet(name, ['adsbygoogle', 'emptyStr']);
const done = assert.async();

const response = await fetch(inputRequest);
const parsedData = await response.text();

assert.strictEqual(response.type, EXPECTED_RESPONSE_TYPE, `Response type is ${EXPECTED_RESPONSE_TYPE}`);
assert.strictEqual(response.url, URL_PATH, `Response URL is ${URL_PATH}`);
assert.ok(response.url.endsWith(URL_PATH), `Response URL is ${URL_PATH}`);
assert.notOk(response.body === null, 'Response body is NOT null');
assert.strictEqual(
response.redirected,
Expand All @@ -490,14 +490,14 @@ if (!isSupported) {
const EXPECTED_RESPONSE_TYPE = 'opaque';
const EXPECTED_RESPONSE_REDIRECTED = false;
const EXPECTED_RESPONSE_STATUS = 0;
const URL_PATH = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
const URL_PATH = '//127.0.0.1/pagead/js/adsbygoogle.js';
const options = {
method: 'HEAD',
mode: 'no-cors',
};
const inputRequest = new Request(URL_PATH, options);

runScriptlet(name, ['pagead2.googlesyndication.com', 'emptyStr']);
runScriptlet(name, ['adsbygoogle', 'emptyStr']);
const done = assert.async();

const response = await fetch(inputRequest);
Expand Down

0 comments on commit 4cda1e0

Please # to comment.