-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathtest.mjs
More file actions
19 lines (14 loc) · 776 Bytes
/
test.mjs
File metadata and controls
19 lines (14 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { initialize, getActorTestDir, runActor, expect, validateDataset } from '../tools.mjs';
const testActorDirname = getActorTestDir(import.meta.url);
await initialize(testActorDirname);
const { datasetItems } = await runActor(testActorDirname, 16384);
await expect(datasetItems.length > 15, 'Number of dataset items');
await expect(validateDataset(datasetItems, ['url', 'heading', 'requestHandlerMode']), 'Dataset items validation');
await expect(
datasetItems.filter((it) => it.requestHandlerMode === 'browser').length >= 1,
'The crawler should handle at least one request in the browser',
);
await expect(
datasetItems.filter((it) => it.requestHandlerMode === 'httpOnly').length >= 5,
'The crawler should handle some requests in http-only mode',
);