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
Fixed broken test
Jan Curnee61bff34f12
diff --git a/test/key_value_store.js b/test/key_value_store.jsindex 1be952d0d..0bd0edf2d 100644--- a/test/key_value_store.js+++ b/test/key_value_store.js@@ -253,7 +253,7 @@ describe('KeyValueStore', () => {delete process.env[ENV_VARS.LOCAL_STORAGE_DIR];});- it('throws on invalid characters in key', async () => {+ it('throws on invalid key', async () => {const store = new KeyValueStoreLocal('my-store-id', LOCAL_STORAGE_DIR);const INVALID_CHARACTERS = '?|\\/"*<>%:';let counter = 0;@@ -262,11 +262,21 @@ describe('KeyValueStore', () => {try {await store.setValue(`my_id_${char}`, 'value');} catch (err) {- if (err.message.match('The "key" parameter may contain only the following characters')) counter++;+ if (err.message.match('The "key" parameter must be at most 256 characters')) counter++;}}expect(counter).to.be.eql(INVALID_CHARACTERS.length);++ // TODO: This throws "ENAMETOOLONG: name too long, unlink" !!!+ // await store.setValue('X'.repeat(256), 'value');++ // test max length+ try {+ await store.setValue('X'.repeat(257), 'value');+ } catch (err) {+ if (err.message.match('The "key" parameter must be at most 256 characters')) counter++;+ }});it('throws if APIFY_DEFAULT_KEY_VALUE_STORE_ID env var is not defined and we use cloud storage', async () => {