From 39730855ee1502d426bafb613125ca708791db26 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 20 Feb 2024 10:18:25 +0100 Subject: [PATCH] test(node): Handle some jest & axios issues --- .../browser-integration-tests/package.json | 2 +- .../node-integration-tests/package.json | 6 +-- .../node-integration-tests/scripts/clean.js | 9 ++++ dev-packages/overhead-metrics/package.json | 2 +- jest/jest.config.js | 3 ++ yarn.lock | 43 +++++-------------- 6 files changed, 28 insertions(+), 37 deletions(-) diff --git a/dev-packages/browser-integration-tests/package.json b/dev-packages/browser-integration-tests/package.json index 7f12a2c7d954..08320f47628c 100644 --- a/dev-packages/browser-integration-tests/package.json +++ b/dev-packages/browser-integration-tests/package.json @@ -49,7 +49,7 @@ "@sentry-internal/rrweb": "2.11.0", "@sentry/browser": "7.100.0", "@sentry/tracing": "7.100.0", - "axios": "1.6.0", + "axios": "1.6.7", "babel-loader": "^8.2.2", "html-webpack-plugin": "^5.5.0", "pako": "^2.1.0", diff --git a/dev-packages/node-integration-tests/package.json b/dev-packages/node-integration-tests/package.json index d9679c29dc27..3826c0024f88 100644 --- a/dev-packages/node-integration-tests/package.json +++ b/dev-packages/node-integration-tests/package.json @@ -14,8 +14,8 @@ "build:dev": "yarn build", "build:transpile": "rollup -c rollup.npm.config.mjs", "build:types": "tsc -p tsconfig.types.json", - "clean": "rimraf -g **/node_modules && run-p clean:docker", - "clean:docker": "node scripts/clean.js", + "clean": "rimraf -g **/node_modules && run-p clean:script", + "clean:script": "node scripts/clean.js", "prisma:init": "(cd suites/tracing/prisma-orm && ts-node ./setup.ts)", "prisma:init:new": "(cd suites/tracing-new/prisma-orm && ts-node ./setup.ts)", "lint": "eslint . --format stylish", @@ -36,7 +36,7 @@ "@types/mysql": "^2.15.21", "@types/pg": "^8.6.5", "apollo-server": "^3.11.1", - "axios": "^0.27.2", + "axios": "^1.6.7", "cors": "^2.8.5", "cron": "^3.1.6", "express": "^4.17.3", diff --git a/dev-packages/node-integration-tests/scripts/clean.js b/dev-packages/node-integration-tests/scripts/clean.js index 0610e39f92d4..b7ae8505e916 100644 --- a/dev-packages/node-integration-tests/scripts/clean.js +++ b/dev-packages/node-integration-tests/scripts/clean.js @@ -17,3 +17,12 @@ for (const path of paths) { // } } + +// eslint-disable-next-line no-console +console.log('Cleaning up watchman...'); + +try { + execSync('watchman watch-del "./../.."; watchman watch-project "./../.."', { stdio: 'inherit' }); +} catch (_) { + // +} diff --git a/dev-packages/overhead-metrics/package.json b/dev-packages/overhead-metrics/package.json index 4e99daa10705..f9fa2967c498 100644 --- a/dev-packages/overhead-metrics/package.json +++ b/dev-packages/overhead-metrics/package.json @@ -19,7 +19,7 @@ "dependencies": { "@octokit/rest": "^19.0.5", "@types/node": "^18.11.17", - "axios": "^1.2.2", + "axios": "^1.6.7", "extract-zip": "^2.0.1", "filesize": "^10.0.6", "fs-extra": "^11.1.0", diff --git a/jest/jest.config.js b/jest/jest.config.js index 3a92f7c81eec..37a2ee48658b 100644 --- a/jest/jest.config.js +++ b/jest/jest.config.js @@ -9,6 +9,9 @@ module.exports = { coverageDirectory: '/coverage', moduleFileExtensions: ['js', 'ts', 'tsx'], testMatch: ['/**/*.test.ts', '/**/*.test.tsx'], + moduleNameMapper: { + '^axios$': require.resolve('axios'), + }, globals: { 'ts-jest': { tsconfig: '/tsconfig.test.json', diff --git a/yarn.lock b/yarn.lock index d6265ed91967..9d103a596e57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8992,38 +8992,12 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" - integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== +axios@1.6.7, axios@^1.0.0, axios@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" + integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - -axios@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.0.tgz#1cb65bd75162c70e9f8d118a905126c4a201d383" - integrity sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^1.2.2: - version "1.3.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.4.tgz#f5760cefd9cfb51fd2481acf88c05f67c4523024" - integrity sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ== - dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -16256,11 +16230,16 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.0.0, follow-redirects@^1.14.9, follow-redirects@^1.15.0: +follow-redirects@^1.0.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"