Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
chore(deps): update vitest monorepo to v5 and adapt the tests (#4217)
renovate[bot]8f57dd3caf22
diff --git a/package.json b/package.jsonindex 0b7ee7fca..19e1cd84a 100644--- a/package.json+++ b/package.json@@ -95,7 +95,7 @@"@types/semver": "^7.7.0","@types/whatwg-mimetype": "^5.0.0","@types/yargs": "^17.0.33",- "@vitest/coverage-v8": "^4.0.16",+ "@vitest/coverage-v8": "^5.0.0","apify": "*","apify-node-curl-impersonate": "^1.0.23","basic-auth-parser": "^0.0.2",@@ -124,7 +124,7 @@"turbo": "^2.10.11","typescript": "^7.0.2","typescript-v6": "npm:typescript@^6.0.0",- "vitest": "^4.1.0-beta.6",+ "vitest": "^5.0.0","zod": "catalog:"},"lint-staged": {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex b3f54c2c7..cd3588f18 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -300,8 +300,8 @@ importers:specifier: ^17.0.33version: 17.0.35'@vitest/coverage-v8':- specifier: ^4.0.16- version: 4.1.11([email protected])+ specifier: ^5.0.0+ version: 5.0.3([email protected])apify:specifier: ^4.0.0-beta.46@@ -387,8 +387,8 @@ importers:specifier: npm:typescript@^6.0.0version: [email protected]vitest:- specifier: ^4.1.0-beta.6- version: 4.1.11(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ specifier: ^5.0.0+ version: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))zod:specifier: 'catalog:'version: 4.6.5@@ -5478,20 +5478,25 @@ packages:resolution: {integrity: sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==}engines: {node: '>= 20'}- '@vitest/[email protected]':- resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-+klsyz7BvT1vCU28Zkfzms1Ia78XD0V41U3FUtRaa3S+vOr/EXvK1O6BvVD7l1RzEjm6SONR2aybOvDDf9u0mQ==}peerDependencies:- '@vitest/browser': 4.1.11- vitest: 4.1.11+ '@vitest/browser': 5.0.3+ vitest: 5.0.3peerDependenciesMeta:'@vitest/browser':optional: true- '@vitest/[email protected]':- resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-9J/JMwOf9AoJhAywhrn7ScKTL38hsWQP/qPG60OtaAFcQ5OXPwKsxZFlbnuCKmZ61m8/lGgHYnFpdyQZUvG/iA==}+ engines: {node: '>=22'}++ '@vitest/[email protected]':+ resolution: {integrity: sha512-gUsfXZJbzPamoIY5TvHFiMMoXESBrUMo+xqaj+rYrWI69+EnvRlYBlP96ZnHPY4vX8kyUpgAnFUCg5wZG/HkDQ==}+ engines: {node: '>=22'}- '@vitest/[email protected]':- resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==}peerDependencies:msw: ^2.4.9vite: ^6.0.0 || ^7.0.0 || ^8.0.0@@ -5501,20 +5506,8 @@ packages:vite:optional: true- '@vitest/[email protected]':- resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==}-- '@vitest/[email protected]':- resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==}+ '@vitest/[email protected]':+ resolution: {integrity: sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==}'@vladfrangu/[email protected]':resolution: {integrity: sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g==}@@ -8668,18 +8661,6 @@ packages:resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==}engines: {node: '>=0.10.0'}- resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==}- engines: {node: '>=10'}-- resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==}- engines: {node: '>=8'}-resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==}engines: {node: '>= 0.4'}@@ -9112,8 +9093,8 @@ packages:resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==}- resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}+ resolution: {integrity: sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==}resolution: {integrity: sha512-UicdXN8zQ3JHlxVq+28afMXPr1z7WNY6+7EJnzTdQWkTAlMLF5fNCCKxJHBQwGaNGR11581EiQmQzx73+MvszA==}@@ -9122,10 +9103,6 @@ packages:resolution: {integrity: sha512-ayF7iT+44LXdxJLTrTd3TLQpFDDvPCBxXxbv+pMUSuHA5Q8zyAfwkRP6aHHwNVFBUFWtxAHqwNJxF8vMZLAbVg==}engines: {node: '>=18'}- resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}- engines: {node: '>=10'}-resolution: {integrity: sha512-sI1NY4lWlXBAfjmCtVWIIpBypbBdhHtcjnwnv+gtCnsaOffyFil3aidszGC8hgzJe+fT1qix05sWxmD/Bmf/oQ==}engines: {node: ^20.17.0 || >=22.9.0}@@ -10169,9 +10146,6 @@ packages:resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==}engines: {node: '>=18'}- resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}-resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}@@ -11410,9 +11384,6 @@ packages:resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==}engines: {node: '>= 0.4'}- resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}-resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}@@ -11557,9 +11528,6 @@ packages:resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==}- resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}-resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==}engines: {node: '>= 0.6'}@@ -11840,8 +11808,9 @@ packages:resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==}- resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}+ resolution: {integrity: sha512-78U2TlB2CnVenajOFzf3BKSm0J6oz5L0NV7g32LCPccvYc0lbWvys4d3uUUCS2B1N8PAf2+aekR8i1KbC3HO7Q==}+ engines: {node: '>=20.0.0'}resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==}@@ -12286,23 +12255,23 @@ packages:yaml:optional: true- resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==}- engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}+ resolution: {integrity: sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==}+ engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0}hasBin: truepeerDependencies:'@edge-runtime/vm': '*''@opentelemetry/api': ^1.9.0- '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0- '@vitest/browser-playwright': 4.1.11- '@vitest/browser-preview': 4.1.11- '@vitest/browser-webdriverio': 4.1.11- '@vitest/coverage-istanbul': 4.1.11- '@vitest/coverage-v8': 4.1.11- '@vitest/ui': 4.1.11+ '@types/node': ^22.0.0 || >=24.0.0+ '@vitest/browser-playwright': 5.0.3+ '@vitest/browser-preview': 5.0.3+ '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0+ '@vitest/coverage-istanbul': 5.0.3+ '@vitest/coverage-v8': 5.0.3+ '@vitest/ui': 5.0.3happy-dom: '*'jsdom: '*'- vite: ^6.0.0 || ^7.0.0 || ^8.0.0+ vite: ^6.4.0 || ^7.0.0 || ^8.0.0peerDependenciesMeta:'@edge-runtime/vm':optional: true@@ -12482,9 +12451,9 @@ packages:engines: {node: ^20.17.0 || >=22.9.0}hasBin: true- resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==}- engines: {node: '>=8'}+ resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==}+ engines: {node: '>=20.11'}hasBin: true@@ -18139,60 +18108,34 @@ snapshots:'@vercel/[email protected]': {}- '@vitest/[email protected]([email protected])':+ '@vitest/[email protected]([email protected])':dependencies:'@bcoe/v8-coverage': 1.0.2- '@vitest/utils': 4.1.11+ '@vitest/istanbul-lib-coverage': 1.0.2+ '@vitest/istanbul-lib-report': 1.0.2ast-v8-to-istanbul: 1.0.7- istanbul-lib-coverage: 3.2.2- istanbul-lib-report: 3.0.1- istanbul-reports: 3.2.0magicast: 0.5.5obug: 2.2.1std-env: 4.3.0tinyrainbow: 3.2.0- vitest: 4.1.11(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ vitest: 5.0.3(@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))++ '@vitest/[email protected]': {}- '@vitest/[email protected]':+ '@vitest/[email protected]':dependencies:- '@standard-schema/spec': 1.1.0- '@types/chai': 5.2.3- '@vitest/spy': 4.1.11- '@vitest/utils': 4.1.11- chai: 6.3.0- tinyrainbow: 3.2.0+ '@vitest/istanbul-lib-coverage': 1.0.2- '@vitest/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@vitest/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))':dependencies:- '@vitest/spy': 4.1.11+ '@jridgewell/trace-mapping': 0.3.31+ '@vitest/spy': 5.0.3estree-walker: 3.0.3- magic-string: 0.30.21+ magic-string: 1.4.3optionalDependencies:vite: 8.3.2(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- '@vitest/[email protected]':- dependencies:- tinyrainbow: 3.2.0-- '@vitest/[email protected]':- dependencies:- '@vitest/utils': 4.1.11- pathe: 2.0.3-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 4.1.11- '@vitest/utils': 4.1.11- magic-string: 0.30.21- pathe: 2.0.3-- '@vitest/[email protected]': {}-- '@vitest/[email protected]':- dependencies:- '@vitest/pretty-format': 4.1.11- convert-source-map: 2.0.0- tinyrainbow: 3.2.0+ '@vitest/[email protected]': {}'@vladfrangu/[email protected]': {}@@ -22145,19 +22088,6 @@ snapshots:- [email protected]: {}-- dependencies:- istanbul-lib-coverage: 3.2.2- make-dir: 4.0.0- supports-color: 7.2.0-- dependencies:- html-escaper: 2.0.2- istanbul-lib-report: 3.0.1-dependencies:define-data-property: 1.1.4@@ -22622,7 +22552,7 @@ snapshots:dependencies:'@jridgewell/sourcemap-codec': 1.6.0@@ -22638,10 +22568,6 @@ snapshots:type-fest: 4.41.0web-worker: 1.5.0- dependencies:- semver: 7.8.5-dependencies:'@npmcli/agent': 4.0.2([email protected])@@ -24255,8 +24181,6 @@ snapshots:- [email protected]: {}-@@ -25853,8 +25777,6 @@ snapshots:side-channel-map: 1.0.1side-channel-weakmap: 1.0.2- [email protected]: {}-@@ -26027,8 +25949,6 @@ snapshots:- [email protected]: {}-@@ -26303,7 +26223,7 @@ snapshots:- [email protected]: {}+ [email protected]: {}@@ -26752,32 +26672,26 @@ snapshots:tsx: 4.21.0yaml: 2.9.1- [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):+ [email protected](@opentelemetry/[email protected])(@types/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):dependencies:- '@vitest/expect': 4.1.11- '@vitest/mocker': 4.1.11([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))- '@vitest/pretty-format': 4.1.11- '@vitest/runner': 4.1.11- '@vitest/snapshot': 4.1.11- '@vitest/spy': 4.1.11- '@vitest/utils': 4.1.11+ '@types/chai': 5.2.3+ '@vitest/mocker': 5.0.3([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ chai: 6.3.0es-module-lexer: 2.3.2expect-type: 1.4.0- magic-string: 0.30.21+ magic-string: 1.4.3obug: 2.2.1- pathe: 2.0.3picomatch: 4.0.7std-env: 4.3.0- tinybench: 2.9.0+ tinybench: 6.2.0tinyexec: 1.3.1tinyglobby: 0.2.17- tinyrainbow: 3.2.0vite: 8.3.2(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- why-is-node-running: 2.3.0+ why-is-node-running: 3.2.1optionalDependencies:'@opentelemetry/api': 1.9.1'@types/node': 24.19.1- '@vitest/coverage-v8': 4.1.11([email protected])+ '@vitest/coverage-v8': 5.0.3([email protected])transitivePeerDependencies:- msw@@ -27013,10 +26927,7 @@ snapshots:dependencies:isexe: 4.0.0- dependencies:- siginfo: 2.0.0- stackback: 0.0.2+ [email protected]: {}dependencies:diff --git a/test/browser-pool/anonymize-proxy-sugar.test.ts b/test/browser-pool/anonymize-proxy-sugar.test.tsindex ea93e2ba5..d89f8b462 100644--- a/test/browser-pool/anonymize-proxy-sugar.test.ts+++ b/test/browser-pool/anonymize-proxy-sugar.test.ts@@ -3,15 +3,13 @@ import { vi } from 'vitest';import { anonymizeProxySugar } from '../../packages/browser-pool/src/anonymize-proxy.js';-describe('anonymizeProxySugar', () => {- // Mock the anonymizeProxy function from proxy-chain- beforeEach(() => {- vi.mock('proxy-chain', () => ({- anonymizeProxy: vi.fn((opts) => Promise.resolve(`anonymized-${opts.url}`)),- closeAnonymizedProxy: vi.fn(() => Promise.resolve()),- }));- });+// Mock the anonymizeProxy function from proxy-chain+vi.mock('proxy-chain', () => ({+ anonymizeProxy: vi.fn((opts) => Promise.resolve(`anonymized-${opts.url}`)),+ closeAnonymizedProxy: vi.fn(() => Promise.resolve()),+}));+describe('anonymizeProxySugar', () => {afterEach(() => {vi.clearAllMocks();});diff --git a/test/utils/social.test.ts b/test/utils/social.test.tsindex 43ce49ae0..4b93c4e60 100644--- a/test/utils/social.test.ts+++ b/test/utils/social.test.ts@@ -376,33 +376,33 @@ describe('utils.social', () => {discords: [],};- test('handles invalid arg', () => {+ test('handles invalid arg', async () => {// @ts-expect-error invalid input type- expect(parseHandlesFromHtml()).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml()).resolves.toEqual(EMPTY_RESULT);// @ts-expect-error invalid input type- expect(parseHandlesFromHtml(undefined)).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml(undefined)).resolves.toEqual(EMPTY_RESULT);// @ts-expect-error invalid input type- expect(parseHandlesFromHtml(null)).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml(null)).resolves.toEqual(EMPTY_RESULT);// @ts-expect-error invalid input type- expect(parseHandlesFromHtml({})).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml({})).resolves.toEqual(EMPTY_RESULT);// @ts-expect-error invalid input type- expect(parseHandlesFromHtml(1234)).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml(1234)).resolves.toEqual(EMPTY_RESULT);});- test('works', () => {- expect(parseHandlesFromHtml('')).resolves.toEqual(EMPTY_RESULT);- expect(parseHandlesFromHtml(' ')).resolves.toEqual(EMPTY_RESULT);+ test('works', async () => {+ await expect(parseHandlesFromHtml('')).resolves.toEqual(EMPTY_RESULT);+ await expect(parseHandlesFromHtml(' ')).resolves.toEqual(EMPTY_RESULT);const html ='use the data in this [YouTube Video](https://www.youtube.com/watch?v=BsidLZKdYWQ).\\n\\n## Sample result\\n' +'use the data in this [YouTube Video](https://www.youtube.com/watch?v=BsidLZKd123).\\\\n\\\\n## Sample result\\\\n';- expect(parseHandlesFromHtml(html)).resolves.toMatchObject({+ await expect(parseHandlesFromHtml(html)).resolves.toMatchObject({youtubes: ['https://www.youtube.com/watch?v=BsidLZKd123','https://www.youtube.com/watch?v=BsidLZKdYWQ',],});- expect(+ await expect(parseHandlesFromHtml(`<html><head>diff --git a/vitest.config.mts b/vitest.config.mtsindex 86a352193..0f4778cc0 100644--- a/vitest.config.mts+++ b/vitest.config.mts@@ -46,23 +46,23 @@ const baseConfig = defineConfig({testTimeout: 60_000,hookTimeout: 60_000,alias: [- { find: 'crawlee', replacement: resolve(__dirname, './packages/crawlee/src') },- { find: '@crawlee/basic', replacement: resolve(__dirname, './packages/basic-crawler/src') },- { find: '@crawlee/browser', replacement: resolve(__dirname, './packages/browser-crawler/src') },- { find: '@crawlee/http', replacement: resolve(__dirname, './packages/http-crawler/src') },- { find: '@crawlee/cheerio', replacement: resolve(__dirname, './packages/cheerio-crawler/src') },- { find: '@crawlee/playwright', replacement: resolve(__dirname, './packages/playwright-crawler/src') },- { find: '@crawlee/puppeteer', replacement: resolve(__dirname, './packages/puppeteer-crawler/src') },- { find: '@crawlee/stagehand', replacement: resolve(__dirname, './packages/stagehand-crawler/src') },- { find: '@crawlee/core/internal', replacement: resolve(__dirname, './packages/core/src/internal') },- { find: '@crawlee/utils/internal', replacement: resolve(__dirname, './packages/utils/src/internal') },+ { find: 'crawlee', replacement: resolve(import.meta.dirname, './packages/crawlee/src') },+ { find: '@crawlee/basic', replacement: resolve(import.meta.dirname, './packages/basic-crawler/src') },+ { find: '@crawlee/browser', replacement: resolve(import.meta.dirname, './packages/browser-crawler/src') },+ { find: '@crawlee/http', replacement: resolve(import.meta.dirname, './packages/http-crawler/src') },+ { find: '@crawlee/cheerio', replacement: resolve(import.meta.dirname, './packages/cheerio-crawler/src') },+ { find: '@crawlee/playwright', replacement: resolve(import.meta.dirname, './packages/playwright-crawler/src') },+ { find: '@crawlee/puppeteer', replacement: resolve(import.meta.dirname, './packages/puppeteer-crawler/src') },+ { find: '@crawlee/stagehand', replacement: resolve(import.meta.dirname, './packages/stagehand-crawler/src') },+ { find: '@crawlee/core/internal', replacement: resolve(import.meta.dirname, './packages/core/src/internal') },+ { find: '@crawlee/utils/internal', replacement: resolve(import.meta.dirname, './packages/utils/src/internal') },// The generic `@crawlee/*` aliases below map specifiers to workspace package sources. They// exclude `@crawlee/fs-storage-native` via a negative lookahead, since it is a real external// (npm) dependency with no `packages/fs-storage-native` source — letting it resolve normally// through node_modules.- { find: /^@crawlee\/(?!fs-storage-native)(.*)\/(.*)$/, replacement: resolve(__dirname, './packages/$1/$2') },- { find: /^@crawlee\/(?!fs-storage-native)(.*)$/, replacement: resolve(__dirname, './packages/$1/src') },- { find: /^test\/(.*)$/, replacement: resolve(__dirname, './test/$1') },+ { find: /^@crawlee\/(?!fs-storage-native)(.*)\/(.*)$/, replacement: resolve(import.meta.dirname, './packages/$1/$2') },+ { find: /^@crawlee\/(?!fs-storage-native)(.*)$/, replacement: resolve(import.meta.dirname, './packages/$1/src') },+ { find: /^test\/(.*)$/, replacement: resolve(import.meta.dirname, './test/$1') },],retry: process.env.RETRY_TESTS ? 3 : 0,projects: [@@ -91,7 +91,7 @@ const baseConfig = defineConfig({});// Optional local override, gitignored. Resolved once per project, so it must stay side-effect free.-const localConfigPath = resolve(__dirname, './vitest.config.local.mts');+const localConfigPath = resolve(import.meta.dirname, './vitest.config.local.mts');let finalConfig = baseConfig;if (existsSync(localConfigPath)) {