diff --git a/package.json b/package.json index 868f2f52..ec05f406 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/build-plugins", "private": true, - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Root of Datadog's Build Plugins monorepo", diff --git a/packages/published/esbuild-plugin/package.json b/packages/published/esbuild-plugin/package.json index 2fd55065..98294747 100644 --- a/packages/published/esbuild-plugin/package.json +++ b/packages/published/esbuild-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/esbuild-plugin", "packageManager": "yarn@4.0.2", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Datadog ESBuild Plugin", diff --git a/packages/published/rollup-plugin/package.json b/packages/published/rollup-plugin/package.json index f64a3a96..1e8febfd 100644 --- a/packages/published/rollup-plugin/package.json +++ b/packages/published/rollup-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/rollup-plugin", "packageManager": "yarn@4.0.2", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Datadog Rollup Plugin", diff --git a/packages/published/rspack-plugin/package.json b/packages/published/rspack-plugin/package.json index 3c6f108f..00dd5cf1 100644 --- a/packages/published/rspack-plugin/package.json +++ b/packages/published/rspack-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/rspack-plugin", "packageManager": "yarn@4.0.2", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Datadog Rspack Plugin", diff --git a/packages/published/vite-plugin/package.json b/packages/published/vite-plugin/package.json index 121ae64a..c17e869c 100644 --- a/packages/published/vite-plugin/package.json +++ b/packages/published/vite-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/vite-plugin", "packageManager": "yarn@4.0.2", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Datadog Vite Plugin", diff --git a/packages/published/webpack-plugin/package.json b/packages/published/webpack-plugin/package.json index 681f1c4c..916fc00d 100644 --- a/packages/published/webpack-plugin/package.json +++ b/packages/published/webpack-plugin/package.json @@ -1,7 +1,7 @@ { "name": "@datadog/webpack-plugin", "packageManager": "yarn@4.0.2", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "author": "Datadog", "description": "Datadog Webpack Plugin", diff --git a/packages/tests/src/_jest/helpers/constants.ts b/packages/tests/src/_jest/helpers/constants.ts index c558a3cc..5279f253 100644 --- a/packages/tests/src/_jest/helpers/constants.ts +++ b/packages/tests/src/_jest/helpers/constants.ts @@ -27,4 +27,7 @@ export const KNOWN_ERRORS: string[] = [ 'ExperimentalWarning: buffer.File', // // Used in Unplugin's xpack loaders. '[DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir', + // Jest 30 globalsCleanup warnings for nock's internal properties that can't be protected. + "[JEST-01] DeprecationWarning: 'logger' property was accessed on [_FetchInterceptor]", + "[JEST-01] DeprecationWarning: 'now' property was accessed on [Function]", ]; diff --git a/packages/tests/src/_jest/setupAfterEnv.ts b/packages/tests/src/_jest/setupAfterEnv.ts index c3e909f9..46b95469 100644 --- a/packages/tests/src/_jest/setupAfterEnv.ts +++ b/packages/tests/src/_jest/setupAfterEnv.ts @@ -3,6 +3,9 @@ // Copyright 2019-Present Datadog, Inc. import console from 'console'; +import https from 'https'; +import http from 'http'; +import { protectProperties } from 'jest-util'; import { toBeWithinRange } from './toBeWithinRange.ts'; import { toRepeatStringTimes } from './toRepeatStringTimes.ts'; @@ -31,9 +34,23 @@ beforeAll(() => { const nock = jest.requireActual('nock'); // Do not send any HTTP requests. nock.disableNetConnect(); + + // Protect timing functions from Jest's globalsCleanup since nock and other + // libraries need them. Without this, we get JEST-01 deprecation warnings in CI. + protectProperties(Date, ['now']); + protectProperties(performance, ['now']); + // Protect HTTP/HTTPS modules that nock patches to prevent warnings about internal properties. + protectProperties(http, ['request', 'get']); + protectProperties(https, ['request', 'get']); }); afterAll(async () => { + // Clean up nock interceptors before Jest's global cleanup to prevent warnings. + const nock = jest.requireActual('nock'); + nock.cleanAll(); + nock.restore(); + nock.activate(); + // Clean the workingDirs from runBundlers(); const { cleanupEverything } = jest.requireActual('./helpers/runBundlers.ts'); await cleanupEverything();