diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 156507f7e..2c683134b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,8 +11,6 @@ updates: - package-ecosystem: npm directory: '/' - allow: - - dependency-name: cross-fetch schedule: interval: 'monthly' diff --git a/package.json b/package.json index 2e07c57d0..e4a91f5fc 100644 --- a/package.json +++ b/package.json @@ -72,9 +72,6 @@ "git add" ] }, - "dependencies": { - "cross-fetch": "^3.1.6" - }, "devDependencies": { "@babel/core": "^7.23.6", "@babel/preset-env": "^7.22.5", diff --git a/rollup.config.js b/rollup.config.js index 853cd9512..210fb6345 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -29,7 +29,6 @@ module.exports = [ // browser-friendly UMD build { input: 'src/browser.ts', // directory to transpilation of typescript - external: ['cross-fetch', 'cross-fetch/polyfill'], output: { name: 'window', extend: true, @@ -75,7 +74,6 @@ module.exports = [ // ES module (for bundlers) build. { input: 'src/index.ts', - external: ['cross-fetch', 'cross-fetch/polyfill'], output: [ { file: getOutputFileName( @@ -96,7 +94,6 @@ module.exports = [ // Compatible only in a nodeJS environment. { input: 'src/index.ts', - external: ['cross-fetch', 'cross-fetch/polyfill'], output: { file: getOutputFileName( // will add .min. in filename if in production env diff --git a/src/http-requests.ts b/src/http-requests.ts index 96e2b606e..fa61ec0a5 100644 --- a/src/http-requests.ts +++ b/src/http-requests.ts @@ -123,10 +123,6 @@ class HttpRequests { body?: any; config?: Record; }) { - if (typeof fetch === 'undefined') { - require('cross-fetch/polyfill'); - } - const constructURL = new URL(url, this.url); if (params) { const queryParams = new URLSearchParams(); diff --git a/tests/settings.test.ts b/tests/settings.test.ts index 9c77d74de..a5c2389f0 100644 --- a/tests/settings.test.ts +++ b/tests/settings.test.ts @@ -171,7 +171,9 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])( }, }; const task = await client.index(index.uid).updateSettings(newSettings); - await client.index(index.uid).waitForTask(task.taskUid); + await client + .index(index.uid) + .waitForTask(task.taskUid, { timeOutMs: 60_000 }); const response = await client.index(index.uid).getSettings(); expect(response).toMatchSnapshot(); diff --git a/tests/utils/meilisearch-test-utils.ts b/tests/utils/meilisearch-test-utils.ts index e9d06c747..0a742d8f9 100644 --- a/tests/utils/meilisearch-test-utils.ts +++ b/tests/utils/meilisearch-test-utils.ts @@ -85,7 +85,7 @@ const clearAllIndexes = async (config: Config): Promise => { const { taskUid } = await client.index(indexUid).delete(); taskIds.push(taskUid); } - await client.waitForTasks(taskIds); + await client.waitForTasks(taskIds, { timeOutMs: 60_000 }); }; function decode64(buff: string) { diff --git a/yarn.lock b/yarn.lock index 2355d0aa6..6fb5a3b39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2776,7 +2776,7 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -cross-fetch@^3.0.4, cross-fetch@^3.1.6: +cross-fetch@^3.0.4: version "3.1.6" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c" integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==