From b4add533e68e4c7b8eebc9a8758a7bfc420e1d02 Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Thu, 11 Sep 2025 15:30:41 -0700 Subject: [PATCH] fix a bunch of typescript problems in our test suite --- bun.lock | 3 ++- package.json | 3 ++- test/bun.lock | 10 +++------- test/harness.ts | 6 +++--- test/package.json | 3 +++ test/tsconfig.json | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/bun.lock b/bun.lock index be4ab107ae..cd6d406a4d 100644 --- a/bun.lock +++ b/bun.lock @@ -41,6 +41,7 @@ }, "overrides": { "@types/bun": "workspace:packages/@types/bun", + "@types/node": "24.3.1", "bun-types": "workspace:packages/bun-types", }, "packages": { @@ -160,7 +161,7 @@ "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - "@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], + "@types/node": ["@types/node@24.3.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g=="], "@types/react": ["@types/react@19.1.10", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-EhBeSYX0Y6ye8pNebpKrwFJq7BoQ8J5SO6NlvNwwHjSj6adXJViPQrKlsyPw7hLBLvckEMO1yxeGdR82YBBlDg=="], diff --git a/package.json b/package.json index 05c7e45386..ad633dafaa 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ }, "resolutions": { "bun-types": "workspace:packages/bun-types", - "@types/bun": "workspace:packages/@types/bun" + "@types/bun": "workspace:packages/@types/bun", + "@types/node": "24.3.1" }, "scripts": { "build": "bun --silent run build:debug", diff --git a/test/bun.lock b/test/bun.lock index d64ec1e967..0651bd5301 100644 --- a/test/bun.lock +++ b/test/bun.lock @@ -118,7 +118,7 @@ }, }, "overrides": { - "react": "../node_modules/react", + "@types/node": "24.3.1", }, "packages": { "@adobe/css-tools": ["@adobe/css-tools@4.4.1", "", {}, "sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ=="], @@ -709,7 +709,7 @@ "@types/nlcst": ["@types/nlcst@2.0.3", "", { "dependencies": { "@types/unist": "*" } }, "sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA=="], - "@types/node": ["@types/node@20.14.6", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw=="], + "@types/node": ["@types/node@24.3.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g=="], "@types/oboe": ["@types/oboe@2.1.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-bXt4BXSQy0N/buSIak1o0TjYAk2SAeK1aZV9xKcb+xVGWYP8NcMOFy2T7Um3kIvEcQJzrdgJ8R6fpbRcp/LEww=="], @@ -2549,7 +2549,7 @@ "undici": ["undici@5.20.0", "", { "dependencies": { "busboy": "^1.6.0" } }, "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g=="], - "undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="], + "undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], "unified": ["unified@11.0.5", "", { "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" } }, "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA=="], @@ -3109,8 +3109,6 @@ "https-proxy-agent/debug": ["debug@4.3.5", "", { "dependencies": { "ms": "2.1.2" } }, "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg=="], - "image-q/@types/node": ["@types/node@16.9.1", "", {}, "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="], - "import-fresh/resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], "jest-diff/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], @@ -3353,8 +3351,6 @@ "upper-case-first/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - "v8-heapsnapshot/@types/node": ["@types/node@18.19.69", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-ECPdY1nlaiO/Y6GUnwgtAAhLNaQ53AyIVz+eILxpEo5OvuqE6yWkqWBIb5dU0DqhKQtMeny+FBD3PK6lm7L5xQ=="], - "verdaccio/@verdaccio/config": ["@verdaccio/config@8.0.0-next-8.1", "", { "dependencies": { "@verdaccio/core": "8.0.0-next-8.1", "@verdaccio/utils": "7.0.1-next-8.1", "debug": "4.3.7", "js-yaml": "4.1.0", "lodash": "4.17.21", "minimatch": "7.4.6" } }, "sha512-goDVOH4e8xMUxjHybJpi5HwIecVFqzJ9jeNFrRUgtUUn0PtFuNMHgxOeqDKRVboZhc5HK90yed8URK/1O6VsUw=="], "verdaccio/@verdaccio/core": ["@verdaccio/core@8.0.0-next-8.1", "", { "dependencies": { "ajv": "8.17.1", "core-js": "3.37.1", "http-errors": "2.0.0", "http-status-codes": "2.3.0", "process-warning": "1.0.0", "semver": "7.6.3" } }, "sha512-kQRCB2wgXEh8H88G51eQgAFK9IxmnBtkQ8sY5FbmB6PbBkyHrbGcCp+2mtRqqo36j0W1VAlfM3XzoknMy6qQnw=="], diff --git a/test/harness.ts b/test/harness.ts index 01b5e79373..3148c45df1 100644 --- a/test/harness.ts +++ b/test/harness.ts @@ -15,8 +15,6 @@ import os from "node:os"; import { dirname, isAbsolute, join } from "path"; import { execSync } from "child_process"; -type Awaitable = T | Promise; - export const BREAKING_CHANGES_BUN_1_2 = false; export const isMacOS = process.platform === "darwin"; @@ -183,7 +181,7 @@ export type DirectoryTree = { | string | Buffer | DirectoryTree - | ((opts: { root: string }) => Awaitable); + | ((opts: { root: string }) => Bun.MaybePromise); }; export async function makeTree(base: string, tree: DirectoryTree) { @@ -204,6 +202,7 @@ export async function makeTree(base: string, tree: DirectoryTree) { makeTree(joined, contents); continue; } + contents; fs.writeFileSync(joined, contents); } } @@ -1221,6 +1220,7 @@ export async function runBunInstall( stderr: "pipe", env, }); + expect(stdout).toBeDefined(); expect(stderr).toBeDefined(); let err: string = stderrForInstall(await stderr.text()); diff --git a/test/package.json b/test/package.json index 8d448facf5..5e559c395e 100644 --- a/test/package.json +++ b/test/package.json @@ -1,5 +1,8 @@ { "name": "test", + "overrides": { + "@types/node": "24.3.1" + }, "devDependencies": { "@types/react": "18.0.28", "@types/react-dom": "18.0.11", diff --git a/test/tsconfig.json b/test/tsconfig.json index 7104437b91..32f86a3265 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "lib": ["ESNext"], + "lib": ["ESNext", "DOM.Iterable", "DOM.AsyncIterable"], // Path remapping "baseUrl": ".", "paths": {