From bce370e67812e6ead41ce8463b9442b1d91a36db Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Sat, 15 Feb 2025 12:12:46 +0000 Subject: [PATCH] chore(deps): bump to latest major tough-cookie; real URLs in tests --- package.json | 3 +-- src/lib/yahooFinanceFetch.spec.ts | 18 +++++++++++------- yarn.lock | 26 ++++++++++++++++++++------ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 497fad8b..35d7b5b4 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,7 @@ "schema.json" ], "dependencies": { - "@types/tough-cookie": "^4.0.2", - "tough-cookie": "^4.1.2", + "tough-cookie": "^5.1.1", "tough-cookie-file-store": "^2.0.3" }, "devDependencies": { diff --git a/src/lib/yahooFinanceFetch.spec.ts b/src/lib/yahooFinanceFetch.spec.ts index 1823b0f3..f4adced9 100644 --- a/src/lib/yahooFinanceFetch.spec.ts +++ b/src/lib/yahooFinanceFetch.spec.ts @@ -120,10 +120,11 @@ describe("yahooFinanceFetch", () => { }); it("yahooFinanceFetch branch check for alternate queue", async () => { + const url = "http://example.com"; const promises = [ - yahooFinanceFetch("", {}), - yahooFinanceFetch("", {}, {}), - yahooFinanceFetch("", {}, { queue: {} }), + yahooFinanceFetch(url, {}), + yahooFinanceFetch(url, {}, {}), + yahooFinanceFetch(url, {}, { queue: {} }), ]; await immediate(); @@ -136,33 +137,36 @@ describe("yahooFinanceFetch", () => { }); it("assert defualts to {} for empty queue opts", async () => { + const url = "http://example.com"; moduleOpts.queue.concurrency = 1; const opts = { ..._opts }; // @ts-ignore: intentional to test runtime failures delete opts.queue; const yahooFinanceFetch = _yahooFinanceFetch.bind({ _env: env, _opts }); - const promise = yahooFinanceFetch("", {}, moduleOpts); + const promise = yahooFinanceFetch(url, {}, moduleOpts); await immediate(); env.fetch.fetches[0].resolveWith({ ok: true }); await expect(promise).resolves.toMatchObject({ ok: true }); }); it("single item in queue", async () => { + const url = "http://example.com"; moduleOpts.queue.concurrency = 1; - const promise = yahooFinanceFetch("", {}, moduleOpts); + const promise = yahooFinanceFetch(url, {}, moduleOpts); await immediate(); env.fetch.fetches[0].resolveWith({ ok: true }); await expect(promise).resolves.toMatchObject({ ok: true }); }); it("waits if exceeding concurrency max", async () => { + const url = "http://example.com"; moduleOpts.queue.concurrency = 1; const promises = [ - yahooFinanceFetch("", {}, moduleOpts), - yahooFinanceFetch("", {}, moduleOpts), + yahooFinanceFetch(url, {}, moduleOpts), + yahooFinanceFetch(url, {}, moduleOpts), ]; await immediate(); diff --git a/yarn.lock b/yarn.lock index 459ef2bd..efbf37c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1915,11 +1915,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== -"@types/tough-cookie@^4.0.2": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" - integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== - "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" @@ -6490,6 +6485,18 @@ tiny-relative-date@^1.3.0: resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== +tldts-core@^6.1.77: + version "6.1.77" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-6.1.77.tgz#0fa4563163a7a61d72c4b05650fb66fc7e815500" + integrity sha512-bCaqm24FPk8OgBkM0u/SrEWJgHnhBWYqeBo6yUmcZJDCHt/IfyWBb+14CXdGi4RInMv4v7eUAin15W0DoA+Ytg== + +tldts@^6.1.32: + version "6.1.77" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-6.1.77.tgz#714e3d1989e562886f2ed97b65e95a8e9f9e92d9" + integrity sha512-lBpoWgy+kYmuXWQ83+R7LlJCnsd9YW8DGpZSHhrMl4b8Ly/1vzOie3OdtmUJDkKxcgRGOehDu5btKkty+JEe+g== + dependencies: + tldts-core "^6.1.77" + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -6514,7 +6521,7 @@ tough-cookie-file-store@^2.0.3: dependencies: tough-cookie "^4.0.0" -tough-cookie@^4.0.0, tough-cookie@^4.1.2: +tough-cookie@^4.0.0: version "4.1.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== @@ -6524,6 +6531,13 @@ tough-cookie@^4.0.0, tough-cookie@^4.1.2: universalify "^0.2.0" url-parse "^1.5.3" +tough-cookie@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-5.1.1.tgz#4641c1fdbf024927e29c5532edb7b6e5377ea1f2" + integrity sha512-Ek7HndSVkp10hmHP9V4qZO1u+pn1RU5sI0Fw+jCU3lyvuMZcgqsNgc6CmJJZyByK4Vm/qotGRJlfgAX8q+4JiA== + dependencies: + tldts "^6.1.32" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"