Skip to content

Commit 660d7c1

Browse files
authored
Update the URLs to the test site (#141)
1 parent fb1d9a3 commit 660d7c1

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

tests/integration/crawlerConductor.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const testURLs = [
1010
];
1111

1212
/**
13-
* @param {import('../../crawler').CollectResult} output
14-
* @param {string} crawlName
13+
* @param {import('../../crawler').CollectResult} output
14+
* @param {string} crawlName
1515
*/
1616
function commonTests(output, crawlName) {
1717
assert(output, `${crawlName} - data not found`);
@@ -60,20 +60,20 @@ async function main() {
6060
const exampleNonFaviconRequests = exampleCom.data.requests.filter(r => !r.url.endsWith('/favicon.ico'));
6161
assert(exampleNonFaviconRequests.length === 1, 'example.com does not load any subresources, should only have one request');
6262
assert(exampleNonFaviconRequests[0].url === 'https://example.com/', 'example.com should have only one request to https://example.com/');
63-
63+
6464
assert(exampleCom.data.cookies.length === 0, 'example.com does not set any cookies');
65-
65+
6666
assert(exampleCom.data.targets.length === 1, 'example.com does have only one target - main frame');
6767
assert(exampleCom.data.targets[0].type === 'page', 'example.com does have only one target - main frame');
68-
68+
6969
assert(Object.keys(exampleCom.data.apis.callStats).length === 0, 'example.com does not execute any JavaScript, API call stats should be empty');
7070

7171
/// duck.com tests
7272
const duckCom = data.find(d => d.initialUrl === 'https://duck.com/');
7373
commonTests(duckCom, 'duck.com');
7474

7575
assert(duckCom.finalUrl !== duckCom.initialUrl, 'duck.com redirects, final url should be different than initial url');
76-
76+
7777
assert(duckCom.data.requests.length > 10, 'duck.com does load multiple subresources');
7878
assert(duckCom.data.requests[0].url === 'https://duck.com/', 'first request should be to "duck.com"');
7979
assert(duckCom.data.requests[0].redirectedTo === 'https://duckduckgo.com/', 'first request should redirect to "duckduckgo.com"');
@@ -90,7 +90,7 @@ async function main() {
9090

9191
assert(Object.keys(duckCom.data.apis.callStats).length > 0, 'duck.com does execute some JS and callStats should NOT be empty');
9292

93-
/// https://privacy-test-pages.glitch.me/tracker-reporting/1major-via-script.html tests
93+
/// https://privacy-test-pages.site/tracker-reporting/1major-via-script.html tests
9494
const privacyTestPages1 = data.find(d => d.initialUrl === 'https://privacy-test-pages.site/tracker-reporting/1major-via-script.html');
9595
commonTests(privacyTestPages1, 'privacy-test-pages/1major-via-script');
9696

tests/integration/detectable.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function main() {
1010
*/
1111
const data = [];
1212
await runCrawlers({
13-
urls: ['https://privacy-test-pages.glitch.me/crawler/'],
13+
urls: ['https://privacy-test-pages.site/crawler/'],
1414
logFunction: () => {},
1515
dataCollectors: [createCollector('requests')],
1616
numberOfCrawlers: 2,

tests/integration/requestCollection.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ const {crawler, RequestCollector} = require('../../main.js');
22
const assert = require('assert');
33

44
async function main() {
5-
6-
const requestData = await crawler(new URL('https://privacy-test-pages.glitch.me/privacy-protections/request-blocking/?run'), {
5+
const requestData = await crawler(new URL('https://privacy-test-pages.site/privacy-protections/request-blocking/?run'), {
76
log: () => {},
87
collectors: [new RequestCollector()]
98
});
@@ -13,7 +12,7 @@ async function main() {
1312
// service worker is not captured on recent Chromium versions, seems to be a race condition https://app.asana.com/0/1118485203673454/1204338487583978/f
1413
// const serviceWorkerRequest = requestData.data.requests.find((/** @type {{url: string}} **/ r) => r.url.endsWith('/service-worker.js'));
1514
// assert(serviceWorkerRequest, 'Service worker request captured.');
16-
15+
1716
const webWorkerRequest = requestData.data.requests.find((/** @type {{url: string}} **/ r) => r.url.endsWith('/worker.js'));
1817

1918
assert(webWorkerRequest, 'Web worker request captured.');

0 commit comments

Comments
 (0)