From 49dff7d3f3c551e04caa9de6b02aad8ee6fd3906 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 02:40:25 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- docs/api/cc.md | 2 +- docs/api/s3.md | 2 +- docs/api/sqlite.md | 2 +- packages/bun-vscode/src/features/debug.ts | 12 +- scripts/agent.mjs | 20 +- scripts/buildkite-failures.ts | 16 +- scripts/google.mjs | 10 +- scripts/machine.mjs | 60 +- scripts/runner.node.mjs | 2 +- scripts/tart.mjs | 8 +- scripts/utils.mjs | 4 +- src/api/schema.d.ts | 2 +- src/api/schema.js | 696 +++++++++--------- .../client/JavaScriptSyntaxHighlighter.ts | 4 +- src/bun.js/api/crypto.classes.ts | 4 +- src/bun.js/api/sockets.classes.ts | 4 +- src/bundler/linker_context/README.md | 2 +- src/codegen/bindgen-lib-internal.ts | 24 +- src/codegen/bindgen.ts | 4 +- src/codegen/generate-classes.ts | 2 +- src/codegen/replacements.ts | 2 +- src/codegen/shared-types.ts | 50 +- ...EPLACE_ME_WITH_YOUR_APP_FILE_NAME.build.ts | 6 +- src/css/build-prefixes.js | 2 +- src/js/builtins/ConsoleObject.ts | 16 +- src/js/internal/debugger.ts | 4 +- src/js/internal/tty.ts | 30 +- src/js/node/http2.ts | 2 +- src/js/node/punycode.ts | 18 +- src/node-fallbacks/util.js | 42 +- test/bake/dev/production.test.ts | 48 +- test/bundler/bundler_browser.test.ts | 72 +- test/bundler/bundler_defer.test.ts | 32 +- test/bundler/bundler_env.test.ts | 2 +- test/bundler/esbuild/default.test.ts | 12 +- test/bundler/native-plugin.test.ts | 16 +- .../transpiler/runtime-transpiler.test.ts | 38 +- test/cli/init/init.test.ts | 30 +- test/cli/install/bun-add.test.ts | 2 +- test/cli/install/bun-audit.test.ts | 44 +- .../bun-install-lifecycle-scripts.test.ts | 30 +- test/cli/install/bun-install-patch.test.ts | 144 ++-- ...un-install-pathname-trailing-slash.test.ts | 2 +- test/cli/install/bun-install-proxy.test.ts | 24 +- test/cli/install/bun-install-registry.test.ts | 229 +++--- test/cli/install/bun-install.test.ts | 142 ++-- test/cli/install/bun-lock.test.ts | 4 +- test/cli/install/bun-pack.test.ts | 163 ++-- test/cli/install/bun-patch.test.ts | 128 ++-- test/cli/install/bun-pm-pkg.test.ts | 24 +- test/cli/install/bun-pm-why.test.ts | 24 +- test/cli/install/bun-publish.test.ts | 16 +- test/cli/install/bun-run.test.ts | 38 +- test/cli/install/bun-upgrade.test.ts | 60 +- test/cli/install/bun-workspaces.test.ts | 32 +- test/cli/install/isolated-install.test.ts | 8 +- test/cli/install/migration/migrate.test.ts | 4 +- .../migration/yarn-lock-migration.test.ts | 30 +- test/cli/install/npmrc.test.ts | 10 +- test/cli/install/overrides.test.ts | 2 +- .../test-dev-peer-dependency-priority.test.ts | 16 +- test/cli/run/env.test.ts | 20 +- test/cli/run/if-present.test.ts | 6 +- .../cli/run/jsx-namespaced-attributes.test.ts | 4 +- test/cli/run/run-process-env.test.ts | 4 +- .../cli/update_interactive_formatting.test.ts | 108 +-- test/cli/update_interactive_snapshots.test.ts | 6 +- test/integration/esbuild/esbuild.test.ts | 4 +- test/js/bun/cookie/cookie.test.ts | 10 +- test/js/bun/glob/proto.test.ts | 8 +- test/js/bun/glob/scan.test.ts | 18 +- .../js/bun/http/async-iterator-stream.test.ts | 2 +- test/js/bun/http/bun-serve-cookies.test.ts | 24 +- test/js/bun/http/bun-serve-file.test.ts | 4 +- test/js/bun/http/bun-server.test.ts | 6 +- test/js/bun/http/proxy.test.js | 2 +- test/js/bun/http/serve-if-none-match.test.ts | 4 +- test/js/bun/http/serve.test.ts | 4 +- test/js/bun/ini/ini.test.ts | 112 +-- test/js/bun/patch/patch.test.ts | 236 +++--- test/js/bun/s3/s3-storage-class.test.ts | 2 +- test/js/bun/s3/s3.test.ts | 8 +- test/js/bun/shell/commands/cp.test.ts | 6 +- test/js/bun/shell/commands/rm.test.ts | 2 +- test/js/bun/shell/lex.test.ts | 408 +++++----- test/js/bun/shell/parse.test.ts | 478 ++++++------ test/js/bun/spawn/spawn.test.ts | 4 +- test/js/bun/sqlite/sqlite.test.js | 6 +- test/js/bun/test/expect.test.js | 8 +- .../snapshot-tests/snapshots/snapshot.test.ts | 4 +- test/js/bun/util/bun-cryptohasher.test.ts | 14 +- test/js/bun/util/which.test.ts | 6 +- test/js/bun/util/zstd.test.ts | 50 +- .../js/bun/websocket/websocket-server.test.ts | 2 +- .../node/child_process/child_process.test.ts | 12 +- test/js/node/crypto/node-crypto.test.js | 252 +++---- test/js/node/fs/cp.test.ts | 2 +- test/js/node/fs/fs.test.ts | 264 +++---- test/js/node/http/node-fetch.test.js | 4 +- .../node/http/node-http-maxHeaderSize.test.ts | 8 +- test/js/node/http/node-http.test.ts | 8 +- test/js/node/http2/node-http2.test.js | 498 ++++++------- test/js/node/process/process-nexttick.test.js | 4 +- .../parallel/util-inspect.test.js | 17 +- .../node/util/parse_args/parse-args.test.mjs | 4 +- test/js/sql/sql.test.ts | 77 +- .../@duckdb/node-api/duckdb.test.ts | 34 +- test/js/third_party/astro/astro-post.test.js | 8 +- .../express-body-parser-test.test.ts | 4 +- .../js/third_party/grpc-js/test-tonic.test.ts | 12 +- .../jsonwebtoken/jwt.malicious.test.js | 2 +- .../validateAsymmetricKey.test.js | 4 +- test/js/web/console/console-log.test.ts | 2 +- .../web/encoding/text-decoder-stream.test.ts | 2 +- test/js/web/fetch/body.test.ts | 12 +- test/js/web/fetch/fetch-args.test.ts | 4 +- .../web/fetch/fetch-connection-header.test.ts | 4 +- test/js/web/fetch/fetch-keepalive.test.ts | 2 +- test/js/web/fetch/fetch.stream.test.ts | 2 +- test/js/web/fetch/fetch.test.ts | 22 +- test/js/web/fetch/headers.test.ts | 8 +- test/js/web/fetch/utf8-bom.test.ts | 12 +- test/js/web/html/URLSearchParams.test.ts | 150 ++-- test/js/web/request/request.test.ts | 8 +- test/js/web/url/url.test.ts | 42 +- test/napi/napi.test.ts | 2 +- test/napi/uv.test.ts | 16 +- test/napi/uv_stub.test.ts | 16 +- test/regression/issue/11806.test.ts | 18 +- test/regression/issue/ctrl-c.test.ts | 4 +- .../update-interactive-formatting.test.ts | 52 +- 131 files changed, 2812 insertions(+), 2838 deletions(-) diff --git a/docs/api/cc.md b/docs/api/cc.md index 383cdfaba0..d0f3409684 100644 --- a/docs/api/cc.md +++ b/docs/api/cc.md @@ -189,7 +189,7 @@ type Defines = Record; cc({ source: "hello.c", define: { - "NDEBUG": "1", + NDEBUG: "1", }, }); ``` diff --git a/docs/api/s3.md b/docs/api/s3.md index 68dae77a39..71a39b6b74 100644 --- a/docs/api/s3.md +++ b/docs/api/s3.md @@ -834,7 +834,7 @@ const response = await fetch("s3://my-bucket/my-file.txt", { endpoint: "https://s3.us-east-1.amazonaws.com", }, headers: { - "range": "bytes=0-1023", + range: "bytes=0-1023", }, }); ``` diff --git a/docs/api/sqlite.md b/docs/api/sqlite.md index f9a707d27c..c7d03b94e6 100644 --- a/docs/api/sqlite.md +++ b/docs/api/sqlite.md @@ -98,7 +98,7 @@ notStrict You can also use an import attribute to load a database. ```ts -import db from "./mydb.sqlite" with { "type": "sqlite" }; +import db from "./mydb.sqlite" with { type: "sqlite" }; console.log(db.query("select * from users LIMIT 1").get()); ``` diff --git a/packages/bun-vscode/src/features/debug.ts b/packages/bun-vscode/src/features/debug.ts index a653fd676f..0008c9fd32 100644 --- a/packages/bun-vscode/src/features/debug.ts +++ b/packages/bun-vscode/src/features/debug.ts @@ -121,8 +121,8 @@ async function injectDebugTerminal(terminal: vscode.Terminal): Promise { name: "JavaScript Debug Terminal", env: { ...env, - "BUN_INSPECT": `${adapter.url}?${query}`, - "BUN_INSPECT_NOTIFY": signal.url, + BUN_INSPECT: `${adapter.url}?${query}`, + BUN_INSPECT_NOTIFY: signal.url, BUN_INSPECT_CONNECT_TO: "", }, }); @@ -164,8 +164,8 @@ async function injectDebugTerminal2() { ...options, env: { ...options.env, - "BUN_INSPECT": `${adapter.url}?${query}`, - "BUN_INSPECT_NOTIFY": signal.url, + BUN_INSPECT: `${adapter.url}?${query}`, + BUN_INSPECT_NOTIFY: signal.url, BUN_INSPECT_CONNECT_TO: " ", }, }; @@ -471,8 +471,8 @@ class TerminalDebugSession extends FileDebugSession { return new vscode.TerminalProfile({ name: "Bun Terminal", env: { - "BUN_INSPECT": `${this.adapter.url}?wait=1`, - "BUN_INSPECT_NOTIFY": this.signal.url, + BUN_INSPECT: `${this.adapter.url}?wait=1`, + BUN_INSPECT_NOTIFY: this.signal.url, BUN_INSPECT_CONNECT_TO: "", }, isTransient: true, diff --git a/scripts/agent.mjs b/scripts/agent.mjs index 14bf2cdd23..4b61cc5caf 100755 --- a/scripts/agent.mjs +++ b/scripts/agent.mjs @@ -146,14 +146,14 @@ async function doBuildkiteAgent(action) { const flags = ["enable-job-log-tmpfile", "no-feature-reporting"]; const options = { - "name": getHostname(), - "token": token || "xxx", - "shell": shell, + name: getHostname(), + token: token || "xxx", + shell: shell, "job-log-path": logsPath, "build-path": join(homePath, "builds"), "hooks-path": join(homePath, "hooks"), "plugins-path": join(homePath, "plugins"), - "experiment": "normalised-upload-paths,resolve-commit-after-checkout,agent-api", + experiment: "normalised-upload-paths,resolve-commit-after-checkout,agent-api", }; let ephemeral; @@ -174,14 +174,14 @@ async function doBuildkiteAgent(action) { } const tags = { - "os": getOs(), - "arch": getArch(), - "kernel": getKernel(), - "abi": getAbi(), + os: getOs(), + arch: getArch(), + kernel: getKernel(), + abi: getAbi(), "abi-version": getAbiVersion(), - "distro": getDistro(), + distro: getDistro(), "distro-version": getDistroVersion(), - "cloud": cloud, + cloud: cloud, }; if (cloud) { diff --git a/scripts/buildkite-failures.ts b/scripts/buildkite-failures.ts index fa506f83f4..100cf87f09 100755 --- a/scripts/buildkite-failures.ts +++ b/scripts/buildkite-failures.ts @@ -152,14 +152,14 @@ const failedJobs = // Platform emoji mapping const platformMap = { - "darwin": "๐ŸŽ", - "macos": "๐ŸŽ", - "ubuntu": "๐Ÿง", - "debian": "๐Ÿง", - "alpine": "๐Ÿง", - "linux": "๐Ÿง", - "windows": "๐ŸชŸ", - "win": "๐ŸชŸ", + darwin: "๐ŸŽ", + macos: "๐ŸŽ", + ubuntu: "๐Ÿง", + debian: "๐Ÿง", + alpine: "๐Ÿง", + linux: "๐Ÿง", + windows: "๐ŸชŸ", + win: "๐ŸชŸ", }; // Fetch annotations by scraping the build page diff --git a/scripts/google.mjs b/scripts/google.mjs index 95c197b119..a12ad4dd85 100644 --- a/scripts/google.mjs +++ b/scripts/google.mjs @@ -293,14 +293,14 @@ export const google = { } const instance = await google.createInstance({ - "name": name, - "zone": "us-central1-a", - "image": imageUrl, + name: name, + zone: "us-central1-a", + image: imageUrl, "machine-type": instanceType || (arch === "aarch64" ? "t2a-standard-2" : "t2d-standard-2"), "boot-disk-auto-delete": true, "boot-disk-size": `${getDiskSize(options)}GB`, - "metadata": this.getMetadata(metadata), - "labels": Object.entries(tags || {}) + metadata: this.getMetadata(metadata), + labels: Object.entries(tags || {}) .filter(([, value]) => value !== undefined) .map(([key, value]) => `${this.getLabel(key)}=${value}`) .join(","), diff --git a/scripts/machine.mjs b/scripts/machine.mjs index 5ea5cdae66..d02ae0edf6 100755 --- a/scripts/machine.mjs +++ b/scripts/machine.mjs @@ -342,7 +342,7 @@ const aws = { await aws.waitImage("image-available", imageId); const [availableImage] = await aws.describeImages({ - "state": "available", + state: "available", "image-id": imageId, }); @@ -396,9 +396,9 @@ const aws = { } const baseImages = await aws.describeImages({ - "state": "available", + state: "available", "owner-alias": owner, - "name": name, + name: name, }); if (!baseImages.length) { @@ -485,10 +485,10 @@ const aws = { ["user-data"]: userData, ["block-device-mappings"]: JSON.stringify(blockDeviceMappings), ["metadata-options"]: JSON.stringify({ - "HttpTokens": "optional", - "HttpEndpoint": "enabled", - "HttpProtocolIpv6": "enabled", - "InstanceMetadataTags": "enabled", + HttpTokens: "optional", + HttpEndpoint: "enabled", + HttpProtocolIpv6: "enabled", + InstanceMetadataTags: "enabled", }), ["tag-specifications"]: JSON.stringify(tagSpecification), ["key-name"]: keyName, @@ -1128,33 +1128,33 @@ async function main() { const { values: args } = parseArgs({ allowPositionals: true, options: { - "cloud": { type: "string", default: "aws" }, - "os": { type: "string", default: "linux" }, - "arch": { type: "string", default: "x64" }, - "distro": { type: "string" }, - "release": { type: "string" }, - "name": { type: "string" }, + cloud: { type: "string", default: "aws" }, + os: { type: "string", default: "linux" }, + arch: { type: "string", default: "x64" }, + distro: { type: "string" }, + release: { type: "string" }, + name: { type: "string" }, "instance-type": { type: "string" }, "image-id": { type: "string" }, "image-name": { type: "string" }, "cpu-count": { type: "string" }, "memory-gb": { type: "string" }, "disk-size-gb": { type: "string" }, - "preemptible": { type: "boolean" }, - "spot": { type: "boolean" }, - "detached": { type: "boolean" }, - "tag": { type: "string", multiple: true }, - "ci": { type: "boolean" }, - "rdp": { type: "boolean" }, - "vnc": { type: "boolean" }, - "feature": { type: "string", multiple: true }, + preemptible: { type: "boolean" }, + spot: { type: "boolean" }, + detached: { type: "boolean" }, + tag: { type: "string", multiple: true }, + ci: { type: "boolean" }, + rdp: { type: "boolean" }, + vnc: { type: "boolean" }, + feature: { type: "string", multiple: true }, "user-data": { type: "string" }, "authorized-user": { type: "string", multiple: true }, "authorized-org": { type: "string", multiple: true }, "no-bootstrap": { type: "boolean" }, "buildkite-token": { type: "string" }, "tailscale-authkey": { type: "string" }, - "docker": { type: "boolean" }, + docker: { type: "boolean" }, }, }); @@ -1169,8 +1169,8 @@ async function main() { } const tags = { - "robobun": "true", - "robobun2": "true", + robobun: "true", + robobun2: "true", "buildkite:token": args["buildkite-token"], "tailscale:authkey": args["tailscale-authkey"], ...Object.fromEntries(args["tag"]?.map(tag => tag.split("=")) ?? []), @@ -1257,20 +1257,20 @@ async function main() { console.log("Creating machine:"); console.table({ "Operating System": os, - "Architecture": arch, - "Distribution": distro ? `${distro} ${release}` : release, - "CI": ci ? "Yes" : "No", + Architecture: arch, + Distribution: distro ? `${distro} ${release}` : release, + CI: ci ? "Yes" : "No", }); const result = await cloud.createMachine(options); const { id, name, imageId, instanceType, region, publicIp } = result; console.log("Created machine:"); console.table({ - "ID": id, - "Name": name || "N/A", + ID: id, + Name: name || "N/A", "Image ID": imageId, "Instance Type": instanceType, - "Region": region, + Region: region, "IP Address": publicIp || "TBD", }); diff --git a/scripts/runner.node.mjs b/scripts/runner.node.mjs index a681c27baa..d486baf8ca 100755 --- a/scripts/runner.node.mjs +++ b/scripts/runner.node.mjs @@ -2445,7 +2445,7 @@ async function uploadJUnitToBuildKite(junitFile) { const response = await fetch(url, { method: "POST", headers: { - "Authorization": `Token token="${getBuildkiteAnalyticsToken()}"`, + Authorization: `Token token="${getBuildkiteAnalyticsToken()}"`, }, body: formData, }); diff --git a/scripts/tart.mjs b/scripts/tart.mjs index e8701b2a48..8ca81c92ef 100644 --- a/scripts/tart.mjs +++ b/scripts/tart.mjs @@ -48,10 +48,10 @@ export const tart = { throw new Error(`Unsupported platform: ${inspect(platform)}`); } const distros = { - "15": "sequoia", - "14": "sonoma", - "13": "ventura", - "12": "monterey", + 15: "sequoia", + 14: "sonoma", + 13: "ventura", + 12: "monterey", }; const distro = distros[release]; if (!distro) { diff --git a/scripts/utils.mjs b/scripts/utils.mjs index 3f7ea67757..5b882db00c 100755 --- a/scripts/utils.mjs +++ b/scripts/utils.mjs @@ -2200,8 +2200,8 @@ export async function getCloudMetadata(name, cloud) { */ export function getCloudMetadataTag(tag, cloud) { const metadata = { - "aws": `tags/instance/${tag}`, - "google": `labels/${tag.replace(":", "-")}`, + aws: `tags/instance/${tag}`, + google: `labels/${tag.replace(":", "-")}`, }; return getCloudMetadata(metadata, cloud); diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts index 3480b3f3c0..440a547c3a 100644 --- a/src/api/schema.d.ts +++ b/src/api/schema.d.ts @@ -60,7 +60,7 @@ export const LoaderKeys: { 14: "sqlite"; sqlite: "sqlite"; 15: "html"; - "html": "html"; + html: "html"; }; export const enum FrameworkEntryPointType { client = 1, diff --git a/src/api/schema.js b/src/api/schema.js index 0265e14f6e..ea7fc2db65 100644 --- a/src/api/schema.js +++ b/src/api/schema.js @@ -1,110 +1,110 @@ const Loader = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - "10": 10, - "11": 11, - "12": 12, - "13": 13, - "14": 14, - "15": 15, - "jsx": 1, - "js": 2, - "ts": 3, - "tsx": 4, - "css": 5, - "file": 6, - "json": 7, - "toml": 8, - "wasm": 9, - "napi": 10, - "base64": 11, - "dataurl": 12, - "text": 13, - "sqlite": 14, - "html": 15, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + 10: 10, + 11: 11, + 12: 12, + 13: 13, + 14: 14, + 15: 15, + jsx: 1, + js: 2, + ts: 3, + tsx: 4, + css: 5, + file: 6, + json: 7, + toml: 8, + wasm: 9, + napi: 10, + base64: 11, + dataurl: 12, + text: 13, + sqlite: 14, + html: 15, }; const LoaderKeys = { - "1": "jsx", - "2": "js", - "3": "ts", - "4": "tsx", - "5": "css", - "6": "file", - "7": "json", - "8": "toml", - "9": "wasm", - "10": "napi", - "11": "base64", - "12": "dataurl", - "13": "text", - "14": "sqlite", - "15": "html", - "jsx": "jsx", - "js": "js", - "ts": "ts", - "tsx": "tsx", - "css": "css", - "file": "file", - "json": "json", - "toml": "toml", - "wasm": "wasm", - "napi": "napi", - "base64": "base64", - "dataurl": "dataurl", - "text": "text", - "sqlite": "sqlite", - "html": "html", + 1: "jsx", + 2: "js", + 3: "ts", + 4: "tsx", + 5: "css", + 6: "file", + 7: "json", + 8: "toml", + 9: "wasm", + 10: "napi", + 11: "base64", + 12: "dataurl", + 13: "text", + 14: "sqlite", + 15: "html", + jsx: "jsx", + js: "js", + ts: "ts", + tsx: "tsx", + css: "css", + file: "file", + json: "json", + toml: "toml", + wasm: "wasm", + napi: "napi", + base64: "base64", + dataurl: "dataurl", + text: "text", + sqlite: "sqlite", + html: "html", }; const FrameworkEntryPointType = { - "1": 1, - "2": 2, - "3": 3, - "client": 1, - "server": 2, - "fallback": 3, + 1: 1, + 2: 2, + 3: 3, + client: 1, + server: 2, + fallback: 3, }; const FrameworkEntryPointTypeKeys = { - "1": "client", - "2": "server", - "3": "fallback", - "client": "client", - "server": "server", - "fallback": "fallback", + 1: "client", + 2: "server", + 3: "fallback", + client: "client", + server: "server", + fallback: "fallback", }; const StackFrameScope = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "Eval": 1, - "Module": 2, - "Function": 3, - "Global": 4, - "Wasm": 5, - "Constructor": 6, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + Eval: 1, + Module: 2, + Function: 3, + Global: 4, + Wasm: 5, + Constructor: 6, }; const StackFrameScopeKeys = { - "1": "Eval", - "2": "Module", - "3": "Function", - "4": "Global", - "5": "Wasm", - "6": "Constructor", - "Eval": "Eval", - "Module": "Module", - "Function": "Function", - "Global": "Global", - "Wasm": "Wasm", - "Constructor": "Constructor", + 1: "Eval", + 2: "Module", + 3: "Function", + 4: "Global", + 5: "Wasm", + 6: "Constructor", + Eval: "Eval", + Module: "Module", + Function: "Function", + Global: "Global", + Wasm: "Wasm", + Constructor: "Constructor", }; function decodeStackFrame(bb) { @@ -347,40 +347,40 @@ function encodeJSException(message, bb) { bb.writeByte(0); } const FallbackStep = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "ssr_disabled": 1, - "create_vm": 2, - "configure_router": 3, - "configure_defines": 4, - "resolve_entry_point": 5, - "load_entry_point": 6, - "eval_entry_point": 7, - "fetch_event_handler": 8, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + ssr_disabled: 1, + create_vm: 2, + configure_router: 3, + configure_defines: 4, + resolve_entry_point: 5, + load_entry_point: 6, + eval_entry_point: 7, + fetch_event_handler: 8, }; const FallbackStepKeys = { - "1": "ssr_disabled", - "2": "create_vm", - "3": "configure_router", - "4": "configure_defines", - "5": "resolve_entry_point", - "6": "load_entry_point", - "7": "eval_entry_point", - "8": "fetch_event_handler", - "ssr_disabled": "ssr_disabled", - "create_vm": "create_vm", - "configure_router": "configure_router", - "configure_defines": "configure_defines", - "resolve_entry_point": "resolve_entry_point", - "load_entry_point": "load_entry_point", - "eval_entry_point": "eval_entry_point", - "fetch_event_handler": "fetch_event_handler", + 1: "ssr_disabled", + 2: "create_vm", + 3: "configure_router", + 4: "configure_defines", + 5: "resolve_entry_point", + 6: "load_entry_point", + 7: "eval_entry_point", + 8: "fetch_event_handler", + ssr_disabled: "ssr_disabled", + create_vm: "create_vm", + configure_router: "configure_router", + configure_defines: "configure_defines", + resolve_entry_point: "resolve_entry_point", + load_entry_point: "load_entry_point", + eval_entry_point: "eval_entry_point", + fetch_event_handler: "fetch_event_handler", }; function decodeProblems(bb) { @@ -532,76 +532,76 @@ function encodeFallbackMessageContainer(message, bb) { bb.writeByte(0); } const ResolveMode = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "disable": 1, - "lazy": 2, - "dev": 3, - "bundle": 4, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + disable: 1, + lazy: 2, + dev: 3, + bundle: 4, }; const ResolveModeKeys = { - "1": "disable", - "2": "lazy", - "3": "dev", - "4": "bundle", - "disable": "disable", - "lazy": "lazy", - "dev": "dev", - "bundle": "bundle", + 1: "disable", + 2: "lazy", + 3: "dev", + 4: "bundle", + disable: "disable", + lazy: "lazy", + dev: "dev", + bundle: "bundle", }; const Target = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "browser": 1, - "node": 2, - "bun": 3, - "bun_macro": 4, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + browser: 1, + node: 2, + bun: 3, + bun_macro: 4, }; const TargetKeys = { - "1": "browser", - "2": "node", - "3": "bun", - "4": "bun_macro", - "browser": "browser", - "node": "node", - "bun": "bun", - "bun_macro": "bun_macro", + 1: "browser", + 2: "node", + 3: "bun", + 4: "bun_macro", + browser: "browser", + node: "node", + bun: "bun", + bun_macro: "bun_macro", }; const CSSInJSBehavior = { - "1": 1, - "2": 2, - "3": 3, - "facade": 1, - "facade_onimportcss": 2, - "auto_onimportcss": 3, + 1: 1, + 2: 2, + 3: 3, + facade: 1, + facade_onimportcss: 2, + auto_onimportcss: 3, }; const CSSInJSBehaviorKeys = { - "1": "facade", - "2": "facade_onimportcss", - "3": "auto_onimportcss", - "facade": "facade", - "facade_onimportcss": "facade_onimportcss", - "auto_onimportcss": "auto_onimportcss", + 1: "facade", + 2: "facade_onimportcss", + 3: "auto_onimportcss", + facade: "facade", + facade_onimportcss: "facade_onimportcss", + auto_onimportcss: "auto_onimportcss", }; const JSXRuntime = { - "1": 1, - "2": 2, - "3": 3, - "automatic": 1, - "classic": 2, - "solid": 3, + 1: 1, + 2: 2, + 3: 3, + automatic: 1, + classic: 2, + solid: 3, }; const JSXRuntimeKeys = { - "1": "automatic", - "2": "classic", - "3": "solid", - "automatic": "automatic", - "classic": "classic", - "solid": "solid", + 1: "automatic", + 2: "classic", + 3: "solid", + automatic: "automatic", + classic: "classic", + solid: "solid", }; function decodeJSX(bb) { @@ -929,28 +929,28 @@ function encodeJavascriptBundleContainer(message, bb) { bb.writeByte(0); } const ScanDependencyMode = { - "1": 1, - "2": 2, - "app": 1, - "all": 2, + 1: 1, + 2: 2, + app: 1, + all: 2, }; const ScanDependencyModeKeys = { - "1": "app", - "2": "all", - "app": "app", - "all": "all", + 1: "app", + 2: "all", + app: "app", + all: "all", }; const ModuleImportType = { - "1": 1, - "2": 2, - "import": 1, - "require": 2, + 1: 1, + 2: 2, + import: 1, + require: 2, }; const ModuleImportTypeKeys = { - "1": "import", - "2": "require", - "import": "import", - "require": "require", + 1: "import", + 2: "require", + import: "import", + require: "require", }; function decodeModuleImportRecord(bb) { @@ -1101,24 +1101,24 @@ function encodeLoaderMap(message, bb) { } } const DotEnvBehavior = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "disable": 1, - "prefix": 2, - "load_all": 3, - "load_all_without_inlining": 4, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + disable: 1, + prefix: 2, + load_all: 3, + load_all_without_inlining: 4, }; const DotEnvBehaviorKeys = { - "1": "disable", - "2": "prefix", - "3": "load_all", - "4": "load_all_without_inlining", - "disable": "disable", - "prefix": "prefix", - "load_all": "load_all", - "load_all_without_inlining": "load_all_without_inlining", + 1: "disable", + 2: "prefix", + 3: "load_all", + 4: "load_all_without_inlining", + disable: "disable", + prefix: "prefix", + load_all: "load_all", + load_all_without_inlining: "load_all_without_inlining", }; function decodeEnvConfig(bb) { @@ -1912,16 +1912,16 @@ function encodeTransformOptions(message, bb) { bb.writeByte(0); } const SourceMapMode = { - "1": 1, - "2": 2, - "inline_into_file": 1, - "external": 2, + 1: 1, + 2: 2, + inline_into_file: 1, + external: 2, }; const SourceMapModeKeys = { - "1": "inline_into_file", - "2": "external", - "inline_into_file": "inline_into_file", - "external": "external", + 1: "inline_into_file", + 2: "external", + inline_into_file: "inline_into_file", + external: "external", }; function decodeFileHandle(bb) { @@ -2156,52 +2156,52 @@ function encodeScannedImport(message, bb) { } } const ImportKind = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "entry_point": 1, - "stmt": 2, - "require": 3, - "dynamic": 4, - "require_resolve": 5, - "at": 6, - "url": 7, - "internal": 8, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + entry_point: 1, + stmt: 2, + require: 3, + dynamic: 4, + require_resolve: 5, + at: 6, + url: 7, + internal: 8, }; const ImportKindKeys = { - "1": "entry_point", - "2": "stmt", - "3": "require", - "4": "dynamic", - "5": "require_resolve", - "6": "at", - "7": "url", - "8": "internal", - "entry_point": "entry_point", - "stmt": "stmt", - "require": "require", - "dynamic": "dynamic", - "require_resolve": "require_resolve", - "at": "at", - "url": "url", - "internal": "internal", + 1: "entry_point", + 2: "stmt", + 3: "require", + 4: "dynamic", + 5: "require_resolve", + 6: "at", + 7: "url", + 8: "internal", + entry_point: "entry_point", + stmt: "stmt", + require: "require", + dynamic: "dynamic", + require_resolve: "require_resolve", + at: "at", + url: "url", + internal: "internal", }; const TransformResponseStatus = { - "1": 1, - "2": 2, - "success": 1, - "fail": 2, + 1: 1, + 2: 2, + success: 1, + fail: 2, }; const TransformResponseStatusKeys = { - "1": "success", - "2": "fail", - "success": "success", - "fail": "fail", + 1: "success", + 2: "fail", + success: "success", + fail: "fail", }; function decodeOutputFile(bb) { @@ -2279,28 +2279,28 @@ function encodeTransformResponse(message, bb) { } } const MessageLevel = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "err": 1, - "warn": 2, - "note": 3, - "info": 4, - "debug": 5, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + err: 1, + warn: 2, + note: 3, + info: 4, + debug: 5, }; const MessageLevelKeys = { - "1": "err", - "2": "warn", - "3": "note", - "4": "info", - "5": "debug", - "err": "err", - "warn": "warn", - "note": "note", - "info": "info", - "debug": "debug", + 1: "err", + 2: "warn", + 3: "note", + 4: "info", + 5: "debug", + err: "err", + warn: "warn", + note: "note", + info: "info", + debug: "debug", }; function decodeLocation(bb) { @@ -2531,72 +2531,72 @@ function encodeLog(message, bb) { } } const Reloader = { - "1": 1, - "2": 2, - "3": 3, - "disable": 1, - "live": 2, - "fast_refresh": 3, + 1: 1, + 2: 2, + 3: 3, + disable: 1, + live: 2, + fast_refresh: 3, }; const ReloaderKeys = { - "1": "disable", - "2": "live", - "3": "fast_refresh", - "disable": "disable", - "live": "live", - "fast_refresh": "fast_refresh", + 1: "disable", + 2: "live", + 3: "fast_refresh", + disable: "disable", + live: "live", + fast_refresh: "fast_refresh", }; const WebsocketMessageKind = { - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "welcome": 1, - "file_change_notification": 2, - "build_success": 3, - "build_fail": 4, - "manifest_success": 5, - "manifest_fail": 6, - "resolve_file": 7, - "file_change_notification_with_hint": 8, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + welcome: 1, + file_change_notification: 2, + build_success: 3, + build_fail: 4, + manifest_success: 5, + manifest_fail: 6, + resolve_file: 7, + file_change_notification_with_hint: 8, }; const WebsocketMessageKindKeys = { - "1": "welcome", - "2": "file_change_notification", - "3": "build_success", - "4": "build_fail", - "5": "manifest_success", - "6": "manifest_fail", - "7": "resolve_file", - "8": "file_change_notification_with_hint", - "welcome": "welcome", - "file_change_notification": "file_change_notification", - "build_success": "build_success", - "build_fail": "build_fail", - "manifest_success": "manifest_success", - "manifest_fail": "manifest_fail", - "resolve_file": "resolve_file", - "file_change_notification_with_hint": "file_change_notification_with_hint", + 1: "welcome", + 2: "file_change_notification", + 3: "build_success", + 4: "build_fail", + 5: "manifest_success", + 6: "manifest_fail", + 7: "resolve_file", + 8: "file_change_notification_with_hint", + welcome: "welcome", + file_change_notification: "file_change_notification", + build_success: "build_success", + build_fail: "build_fail", + manifest_success: "manifest_success", + manifest_fail: "manifest_fail", + resolve_file: "resolve_file", + file_change_notification_with_hint: "file_change_notification_with_hint", }; const WebsocketCommandKind = { - "1": 1, - "2": 2, - "3": 3, - "build": 1, - "manifest": 2, - "build_with_file_path": 3, + 1: 1, + 2: 2, + 3: 3, + build: 1, + manifest: 2, + build_with_file_path: 3, }; const WebsocketCommandKindKeys = { - "1": "build", - "2": "manifest", - "3": "build_with_file_path", - "build": "build", - "manifest": "manifest", - "build_with_file_path": "build_with_file_path", + 1: "build", + 2: "manifest", + 3: "build_with_file_path", + build: "build", + manifest: "manifest", + build_with_file_path: "build_with_file_path", }; function decodeWebsocketMessage(bb) { @@ -3360,16 +3360,16 @@ function encodeGetTestsRequest(message, bb) { } } const TestKind = { - "1": 1, - "2": 2, - "test_fn": 1, - "describe_fn": 2, + 1: 1, + 2: 2, + test_fn: 1, + describe_fn: 2, }; const TestKindKeys = { - "1": "test_fn", - "2": "describe_fn", - "test_fn": "test_fn", - "describe_fn": "describe_fn", + 1: "test_fn", + 2: "describe_fn", + test_fn: "test_fn", + describe_fn: "describe_fn", }; function decodeTestResponseItem(bb) { diff --git a/src/bake/client/JavaScriptSyntaxHighlighter.ts b/src/bake/client/JavaScriptSyntaxHighlighter.ts index 474ea5f9e5..6d8bb10436 100644 --- a/src/bake/client/JavaScriptSyntaxHighlighter.ts +++ b/src/bake/client/JavaScriptSyntaxHighlighter.ts @@ -536,7 +536,7 @@ export class DraculaSyntaxHighlighter { const startNewLine = () => { if (lineContent) { - result += this.buildHtmlElement("div", { "class": "line" }, lineContent); + result += this.buildHtmlElement("div", { class: "line" }, lineContent); lineContent = ""; } }; @@ -559,7 +559,7 @@ export class DraculaSyntaxHighlighter { startNewLine(); // Wrap everything in pre tag - return this.buildHtmlElement("pre", { "class": classAttr }, result); + return this.buildHtmlElement("pre", { class: classAttr }, result); } public highlightLine() { diff --git a/src/bun.js/api/crypto.classes.ts b/src/bun.js/api/crypto.classes.ts index 9f64ec1f0e..fd81fc59e3 100644 --- a/src/bun.js/api/crypto.classes.ts +++ b/src/bun.js/api/crypto.classes.ts @@ -55,7 +55,7 @@ export default [ length: 1, DOMJIT: { returns: "JSString", - "pure": false, + pure: false, args: [], }, }, @@ -63,7 +63,7 @@ export default [ fn: "timingSafeEqual", DOMJIT: { returns: "JSValue", - "pure": false, + pure: false, args: ["JSUint8Array", "JSUint8Array"], }, length: 2, diff --git a/src/bun.js/api/sockets.classes.ts b/src/bun.js/api/sockets.classes.ts index 95500fbe9e..4e06a4ae4e 100644 --- a/src/bun.js/api/sockets.classes.ts +++ b/src/bun.js/api/sockets.classes.ts @@ -207,12 +207,12 @@ function generate(ssl) { fn: "getServername", length: 0, }, - "writeBuffered": { + writeBuffered: { fn: "writeBuffered", length: 2, privateSymbol: "write", }, - "endBuffered": { + endBuffered: { fn: "endBuffered", length: 2, privateSymbol: "end", diff --git a/src/bundler/linker_context/README.md b/src/bundler/linker_context/README.md index 61ef4b0008..e1e8f01ec5 100644 --- a/src/bundler/linker_context/README.md +++ b/src/bundler/linker_context/README.md @@ -242,7 +242,7 @@ var styles_module_default = { }; // data.json โ†’ generates: -var data_default = { "name": "example", "version": "1.0" }; +var data_default = { name: "example", version: "1.0" }; ``` **Step 4: Match Imports with Exports** diff --git a/src/codegen/bindgen-lib-internal.ts b/src/codegen/bindgen-lib-internal.ts index db0e6fb6ab..88de9cc819 100644 --- a/src/codegen/bindgen-lib-internal.ts +++ b/src/codegen/bindgen-lib-internal.ts @@ -953,19 +953,19 @@ export function cAbiTypeName(type: CAbiType) { { "*anyopaque": "void*", "*JSGlobalObject": "JSC::JSGlobalObject*", - "JSValue": "JSValue", + JSValue: "JSValue", "JSValue.MaybeException": "JSValue", - "bool": "bool", - "u8": "uint8_t", - "u16": "uint16_t", - "u32": "uint32_t", - "u64": "uint64_t", - "i8": "int8_t", - "i16": "int16_t", - "i32": "int32_t", - "i64": "int64_t", - "f64": "double", - "usize": "size_t", + bool: "bool", + u8: "uint8_t", + u16: "uint16_t", + u32: "uint32_t", + u64: "uint64_t", + i8: "int8_t", + i16: "int16_t", + i32: "int32_t", + i64: "int64_t", + f64: "double", + usize: "size_t", "bun.String": "BunString", u0: "void", } satisfies Record, string> diff --git a/src/codegen/bindgen.ts b/src/codegen/bindgen.ts index a33ad4a470..b4f2153716 100644 --- a/src/codegen/bindgen.ts +++ b/src/codegen/bindgen.ts @@ -403,8 +403,8 @@ function getSimpleIdlType(type: TypeImpl): string | undefined { }>`; } else { const rangeAdaptor = { - "clamp": "WebCore::IDLClampAdaptor", - "enforce": "WebCore::IDLEnforceRangeAdaptor", + clamp: "WebCore::IDLClampAdaptor", + enforce: "WebCore::IDLEnforceRangeAdaptor", }[range[0]]; assert(rangeAdaptor); entry = `${rangeAdaptor}<${entry}>`; diff --git a/src/codegen/generate-classes.ts b/src/codegen/generate-classes.ts index 5cb5038cb8..864a147d3d 100644 --- a/src/codegen/generate-classes.ts +++ b/src/codegen/generate-classes.ts @@ -12,7 +12,7 @@ const files = process.argv.slice(2); const outBase = files.pop(); let externs = ""; const CommonIdentifiers = { - "name": true, + name: true, }; function toIdentifier(propertyName) { if (CommonIdentifiers[propertyName]) { diff --git a/src/codegen/replacements.ts b/src/codegen/replacements.ts index fd1f3438ad..67d05a582e 100644 --- a/src/codegen/replacements.ts +++ b/src/codegen/replacements.ts @@ -120,7 +120,7 @@ export const warnOnIdentifiersNotPresentAtRuntime = [ const debug = process.argv[2] === "--debug=ON"; export const define: Record = { "process.env.NODE_ENV": JSON.stringify(debug ? "development" : "production"), - "IS_BUN_DEVELOPMENT": String(debug), + IS_BUN_DEVELOPMENT: String(debug), $streamClosed: "1", $streamClosing: "2", diff --git a/src/codegen/shared-types.ts b/src/codegen/shared-types.ts index 0307c9c322..8dd24c10c4 100644 --- a/src/codegen/shared-types.ts +++ b/src/codegen/shared-types.ts @@ -8,47 +8,47 @@ const Environment = bun.Environment; export const sharedTypes: Record = { // Basic types - "bool": "bool", - "char": "u8", + bool: "bool", + char: "u8", "unsigned char": "u8", "signed char": "i8", - "char16_t": "u16", - "short": "c_short", + char16_t: "u16", + short: "c_short", "unsigned short": "c_ushort", - "int": "c_int", - "unsigned": "c_uint", + int: "c_int", + unsigned: "c_uint", "unsigned int": "c_uint", - "long": "c_long", + long: "c_long", "unsigned long": "c_ulong", "long long": "c_longlong", "unsigned long long": "c_ulonglong", - "float": "f32", - "double": "f64", - "size_t": "usize", - "ssize_t": "isize", - "int8_t": "i8", - "uint8_t": "u8", - "int16_t": "i16", - "uint16_t": "u16", - "int32_t": "i32", - "uint32_t": "u32", - "int64_t": "i64", - "uint64_t": "u64", + float: "f32", + double: "f64", + size_t: "usize", + ssize_t: "isize", + int8_t: "i8", + uint8_t: "u8", + int16_t: "i16", + uint16_t: "u16", + int32_t: "i32", + uint32_t: "u32", + int64_t: "i64", + uint64_t: "u64", // Common Bun types - "BunString": "bun.String", + BunString: "bun.String", "JSC::EncodedJSValue": "jsc.JSValue", "JSC::JSGlobalObject": "jsc.JSGlobalObject", - "ZigException": "jsc.ZigException", + ZigException: "jsc.ZigException", "Inspector::InspectorHTTPServerAgent": "HTTPServerAgent.InspectorHTTPServerAgent", - "HotReloadId": "HTTPServerAgent.HotReloadId", - "ServerId": "HTTPServerAgent.ServerId", - "Route": "HTTPServerAgent.Route", + HotReloadId: "HTTPServerAgent.HotReloadId", + ServerId: "HTTPServerAgent.ServerId", + Route: "HTTPServerAgent.Route", "Zig::GlobalObject": "jsc.JSGlobalObject", "JSC::VM": "jsc.VM", "WTF::StringImpl": "bun.WTF._StringImplStruct", "WebCore::DOMURL": "bun.DOMURL", - "ZigString": "bun.jsc.ZigString", + ZigString: "bun.jsc.ZigString", "JSC::JSPromise": "bun.jsc.JSPromise", "JSC::JSMap": "bun.jsc.JSMap", "JSC::CustomGetterSetter": "bun.jsc.CustomGetterSetter", diff --git a/src/create/projects/react-shadcn-spa/REPLACE_ME_WITH_YOUR_APP_FILE_NAME.build.ts b/src/create/projects/react-shadcn-spa/REPLACE_ME_WITH_YOUR_APP_FILE_NAME.build.ts index 831a678fc1..22a5260f3b 100644 --- a/src/create/projects/react-shadcn-spa/REPLACE_ME_WITH_YOUR_APP_FILE_NAME.build.ts +++ b/src/create/projects/react-shadcn-spa/REPLACE_ME_WITH_YOUR_APP_FILE_NAME.build.ts @@ -158,9 +158,9 @@ const result = await build({ const end = performance.now(); const outputTable = result.outputs.map(output => ({ - "File": path.relative(process.cwd(), output.path), - "Type": output.kind, - "Size": formatFileSize(output.size), + File: path.relative(process.cwd(), output.path), + Type: output.kind, + Size: formatFileSize(output.size), })); console.table(outputTable); diff --git a/src/css/build-prefixes.js b/src/css/build-prefixes.js index 91f399e208..001d2cd62e 100644 --- a/src/css/build-prefixes.js +++ b/src/css/build-prefixes.js @@ -208,7 +208,7 @@ let cssFeatureMappings = { "css-matches-pseudo": "IsSelector", "css-sel2": "Selectors2", "css-sel3": "Selectors3", - "calc": "CalcFunction", + calc: "CalcFunction", }; let cssFeatureOverrides = { diff --git a/src/js/builtins/ConsoleObject.ts b/src/js/builtins/ConsoleObject.ts index 312b280923..2b8160d22f 100644 --- a/src/js/builtins/ConsoleObject.ts +++ b/src/js/builtins/ConsoleObject.ts @@ -352,8 +352,8 @@ export function createConsoleConstructor(console: typeof globalThis.console) { // Eager version for the Console constructor value: function (stdout, stderr) { Object.defineProperties(this, { - "_stdout": { ...consolePropAttributes, value: stdout }, - "_stderr": { ...consolePropAttributes, value: stderr }, + _stdout: { ...consolePropAttributes, value: stdout }, + _stderr: { ...consolePropAttributes, value: stderr }, }); }, }, @@ -365,7 +365,7 @@ export function createConsoleConstructor(console: typeof globalThis.console) { let stdout; let stderr; Object.defineProperties(this, { - "_stdout": { + _stdout: { enumerable: false, configurable: true, get() { @@ -376,7 +376,7 @@ export function createConsoleConstructor(console: typeof globalThis.console) { stdout = value; }, }, - "_stderr": { + _stderr: { enumerable: false, configurable: true, get() { @@ -396,19 +396,19 @@ export function createConsoleConstructor(console: typeof globalThis.console) { ...consolePropAttributes, value: function (ignoreErrors, colorMode, groupIndentation = 2) { Object.defineProperties(this, { - "_stdoutErrorHandler": { + _stdoutErrorHandler: { ...consolePropAttributes, value: createWriteErrorHandler(this, kUseStdout), }, - "_stderrErrorHandler": { + _stderrErrorHandler: { ...consolePropAttributes, value: createWriteErrorHandler(this, kUseStderr), }, - "_ignoreErrors": { + _ignoreErrors: { ...consolePropAttributes, value: Boolean(ignoreErrors), }, - "_times": { ...consolePropAttributes, value: new Map() }, + _times: { ...consolePropAttributes, value: new Map() }, // Corresponds to https://console.spec.whatwg.org/#count-map [kCounts]: { ...consolePropAttributes, value: new Map() }, [kColorMode]: { ...consolePropAttributes, value: colorMode }, diff --git a/src/js/internal/debugger.ts b/src/js/internal/debugger.ts index 911bb4eaef..05a7eb92a5 100644 --- a/src/js/internal/debugger.ts +++ b/src/js/internal/debugger.ts @@ -356,7 +356,7 @@ class Debugger { return new Response(null, { status: 426, // Upgrade Required headers: { - "Upgrade": "websocket", + Upgrade: "websocket", }, }); } @@ -510,7 +510,7 @@ async function connectToUnixServer( function versionInfo(): unknown { return { "Protocol-Version": "1.3", - "Browser": "Bun", + Browser: "Bun", "User-Agent": navigator.userAgent, "WebKit-Version": process.versions.webkit, "Bun-Version": Bun.version, diff --git a/src/js/internal/tty.ts b/src/js/internal/tty.ts index 9191ad4330..115265bea3 100644 --- a/src/js/internal/tty.ts +++ b/src/js/internal/tty.ts @@ -13,24 +13,24 @@ const COLORS_16m = 24; // distribution of this file, with or without modification, are permitted // provided the copyright notice and this notice are preserved. const TERM_ENVS = { - "eterm": COLORS_16, - "cons25": COLORS_16, - "console": COLORS_16, - "cygwin": COLORS_16, - "dtterm": COLORS_16, - "gnome": COLORS_16, - "hurd": COLORS_16, - "jfbterm": COLORS_16, - "konsole": COLORS_16, - "kterm": COLORS_16, - "mlterm": COLORS_16, - "mosh": COLORS_16m, - "putty": COLORS_16, - "st": COLORS_16, + eterm: COLORS_16, + cons25: COLORS_16, + console: COLORS_16, + cygwin: COLORS_16, + dtterm: COLORS_16, + gnome: COLORS_16, + hurd: COLORS_16, + jfbterm: COLORS_16, + konsole: COLORS_16, + kterm: COLORS_16, + mlterm: COLORS_16, + mosh: COLORS_16m, + putty: COLORS_16, + st: COLORS_16, // https://github.com/da-x/rxvt-unicode/tree/v9.22-with-24bit-color "rxvt-unicode-24bit": COLORS_16m, // https://gist.github.com/XVilka/8346728#gistcomment-2823421 - "terminator": COLORS_16m, + terminator: COLORS_16m, }; const TERM_ENVS_REG_EXP = [/ansi/, /color/, /linux/, /^con[0-9]*x[0-9]/, /^rxvt/, /^screen/, /^xterm/, /^vt100/]; diff --git a/src/js/node/http2.ts b/src/js/node/http2.ts index 93d23062c3..ec8eb64dec 100644 --- a/src/js/node/http2.ts +++ b/src/js/node/http2.ts @@ -884,7 +884,7 @@ class Http2ServerResponse extends Stream { stream.additionalHeaders({ ...headers, [HTTP2_HEADER_STATUS]: HTTP_STATUS_EARLY_HINTS, - "Link": linkHeaderValue, + Link: linkHeaderValue, }); return true; } diff --git a/src/js/node/punycode.ts b/src/js/node/punycode.ts index 97bf5dce6b..b8056f557e 100644 --- a/src/js/node/punycode.ts +++ b/src/js/node/punycode.ts @@ -21,7 +21,7 @@ const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ const errors = { - "overflow": "Overflow: input needs wider integers to process", + overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input", }; @@ -395,7 +395,7 @@ export default { * @memberOf punycode * @type String */ - "version": "2.1.0", + version: "2.1.0", /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. @@ -403,12 +403,12 @@ export default { * @memberOf punycode * @type Object */ - "ucs2": { - "decode": ucs2decode, - "encode": ucs2encode, + ucs2: { + decode: ucs2decode, + encode: ucs2encode, }, - "decode": decode, - "encode": encode, - "toASCII": toASCII, - "toUnicode": toUnicode, + decode: decode, + encode: encode, + toASCII: toASCII, + toUnicode: toUnicode, }; diff --git a/src/node-fallbacks/util.js b/src/node-fallbacks/util.js index 79b4ce6ce3..bc392f0344 100644 --- a/src/node-fallbacks/util.js +++ b/src/node-fallbacks/util.js @@ -126,31 +126,31 @@ export const inspect = /* @__PURE__ */ (i => // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics ( (i.colors = { - "bold": [1, 22], - "italic": [3, 23], - "underline": [4, 24], - "inverse": [7, 27], - "white": [37, 39], - "grey": [90, 39], - "black": [30, 39], - "blue": [34, 39], - "cyan": [36, 39], - "green": [32, 39], - "magenta": [35, 39], - "red": [31, 39], - "yellow": [33, 39], + bold: [1, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + white: [37, 39], + grey: [90, 39], + black: [30, 39], + blue: [34, 39], + cyan: [36, 39], + green: [32, 39], + magenta: [35, 39], + red: [31, 39], + yellow: [33, 39], }), // Don't use 'blue' not visible on cmd.exe (i.styles = { - "special": "cyan", - "number": "yellow", - "boolean": "yellow", - "undefined": "grey", - "null": "bold", - "string": "green", - "date": "magenta", + special: "cyan", + number: "yellow", + boolean: "yellow", + undefined: "grey", + null: "bold", + string: "green", + date: "magenta", // "name": intentionally not styling - "regexp": "red", + regexp: "red", }), (i.custom = Symbol.for("nodejs.util.inspect.custom")), i diff --git a/test/bake/dev/production.test.ts b/test/bake/dev/production.test.ts index ed9b7d2689..4eac21c2cf 100644 --- a/test/bake/dev/production.test.ts +++ b/test/bake/dev/production.test.ts @@ -19,10 +19,10 @@ describe("production", () => { return
Hello World
; }`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), @@ -306,10 +306,10 @@ export default function GettingStarted() { const dir = await tempDirWithBakeDeps("bake-production-no-pages", { "app.ts": `export default { app: { framework: "react" } };`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), @@ -349,10 +349,10 @@ export default function Client() { return
Hello World
; }`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), @@ -390,10 +390,10 @@ export default function IndexPage() { ); }`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), @@ -445,10 +445,10 @@ export default function Counter() { ); }`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), @@ -512,10 +512,10 @@ export default function IndexPage() { ); }`, "package.json": JSON.stringify({ - "name": "test-app", - "version": "1.0.0", - "devDependencies": { - "react": "^18.0.0", + name: "test-app", + version: "1.0.0", + devDependencies: { + react: "^18.0.0", "react-dom": "^18.0.0", }, }), diff --git a/test/bundler/bundler_browser.test.ts b/test/bundler/bundler_browser.test.ts index 53829e84f5..34ad76b49d 100644 --- a/test/bundler/bundler_browser.test.ts +++ b/test/bundler/bundler_browser.test.ts @@ -4,41 +4,41 @@ import { itBundled } from "./expectBundled"; describe("bundler", () => { const nodePolyfillList = { - "assert": "polyfill", - "buffer": "polyfill", - "child_process": "no-op", - "cluster": "no-op", - "console": "polyfill", - "constants": "polyfill", - "crypto": "polyfill", - "dgram": "no-op", - "dns": "no-op", - "domain": "polyfill", - "events": "polyfill", - "fs": "no-op", - "http": "polyfill", - "https": "polyfill", - "module": "no-op", - "net": "polyfill", - "os": "polyfill", - "path": "polyfill", - "perf_hooks": "no-op", - "process": "polyfill", - "punycode": "polyfill", - "querystring": "polyfill", - "readline": "no-op", - "repl": "no-op", - "stream": "polyfill", - "string_decoder": "polyfill", - "sys": "polyfill", - "timers": "polyfill", - "tls": "no-op", - "tty": "polyfill", - "url": "polyfill", - "util": "polyfill", - "v8": "no-op", - "vm": "no-op", - "zlib": "polyfill", + assert: "polyfill", + buffer: "polyfill", + child_process: "no-op", + cluster: "no-op", + console: "polyfill", + constants: "polyfill", + crypto: "polyfill", + dgram: "no-op", + dns: "no-op", + domain: "polyfill", + events: "polyfill", + fs: "no-op", + http: "polyfill", + https: "polyfill", + module: "no-op", + net: "polyfill", + os: "polyfill", + path: "polyfill", + perf_hooks: "no-op", + process: "polyfill", + punycode: "polyfill", + querystring: "polyfill", + readline: "no-op", + repl: "no-op", + stream: "polyfill", + string_decoder: "polyfill", + sys: "polyfill", + timers: "polyfill", + tls: "no-op", + tty: "polyfill", + url: "polyfill", + util: "polyfill", + v8: "no-op", + vm: "no-op", + zlib: "polyfill", }; itBundled("browser/NodeBuffer#12272", { @@ -211,7 +211,7 @@ describe("bundler", () => { // unsure: do we want polyfills or no-op stuff like node:* has // right now all error except bun:wrap which errors at resolve time, but is included if external const bunModules: Record = { - "bun": "error", + bun: "error", "bun:ffi": "error", "bun:dns": "error", "bun:test": "error", diff --git a/test/bundler/bundler_defer.test.ts b/test/bundler/bundler_defer.test.ts index 8f16b9918d..ef3b890e4f 100644 --- a/test/bundler/bundler_defer.test.ts +++ b/test/bundler/bundler_defer.test.ts @@ -592,31 +592,31 @@ warn: (msg: string) => console.warn(\`[WARN] \${msg}\`) const output = await Bun.$`cat ${path.join(folder, "dist", "output.json")}`.json(); expect(output).toStrictEqual({ "index.ts": { - "imports": [ - { "imported": ["greet"], "dep": "./utils/greetings" }, - { "imported": ["formatDate"], "dep": "./utils/dates" }, - { "imported": ["calculateTotal"], "dep": "./math/calculations" }, - { "imported": ["logger"], "dep": "./services/logger" }, - { "imported": ["moduleData"], "dep": "../module_data.json" }, - { "imported": ["path"], "dep": "path" }, + imports: [ + { imported: ["greet"], dep: "./utils/greetings" }, + { imported: ["formatDate"], dep: "./utils/dates" }, + { imported: ["calculateTotal"], dep: "./math/calculations" }, + { imported: ["logger"], dep: "./services/logger" }, + { imported: ["moduleData"], dep: "../module_data.json" }, + { imported: ["path"], dep: "path" }, ], - "exports": [], + exports: [], }, "greetings.ts": { - "imports": [], - "exports": [{ "ident": "greet" }], + imports: [], + exports: [{ ident: "greet" }], }, "dates.ts": { - "imports": [], - "exports": [{ "ident": "formatDate" }], + imports: [], + exports: [{ ident: "formatDate" }], }, "calculations.ts": { - "imports": [], - "exports": [{ "ident": "calculateTotal" }, { "ident": "multiply" }], + imports: [], + exports: [{ ident: "calculateTotal" }, { ident: "multiply" }], }, "logger.ts": { - "imports": [], - "exports": [{ "ident": "logger" }], + imports: [], + exports: [{ ident: "logger" }], }, }); }); diff --git a/test/bundler/bundler_env.test.ts b/test/bundler/bundler_env.test.ts index b87ab47ab6..4803468844 100644 --- a/test/bundler/bundler_env.test.ts +++ b/test/bundler/bundler_env.test.ts @@ -111,7 +111,7 @@ for (let backend of ["api", "cli"] as const) { }, run: { env: { - "BASE_URL": "https://api.example.com", + BASE_URL: "https://api.example.com", }, stdout: "process.env.BASE_URL\n$BASE_URL", }, diff --git a/test/bundler/esbuild/default.test.ts b/test/bundler/esbuild/default.test.ts index a17df2e2ff..7d6688eb22 100644 --- a/test/bundler/esbuild/default.test.ts +++ b/test/bundler/esbuild/default.test.ts @@ -1789,7 +1789,7 @@ describe("bundler", () => { "/es6-ns-export-abstract-class.ts": `namespace ns { export abstract class Foo {} } console.log("es6-ns-export-abstract-class.ts:",JSON.stringify(this))`, }, run: { - "stdout": ` + stdout: ` cjs.js: {} es6-import-stmt.js: {} es6-import-assign.ts: {} @@ -6254,16 +6254,16 @@ describe("bundler", () => { "/node_modules/@scope/prefix-foo/index.js": `console.log(11)`, }, alias: { - "pkg1": "alias1", - "pkg2": "alias2", - "pkg3": "alias3", + pkg1: "alias1", + pkg2: "alias2", + pkg3: "alias3", "@scope/pkg4": "alias4", "@scope/pkg5": "alias5", "@abs-path/pkg6": `/alias6/dir`, "@abs-path/pkg7": `/alias7/dir`, "@scope-only": "/alias8/dir", - "slash": "/alias9/some/file.js", - "prefix": "alias10", + slash: "/alias9/some/file.js", + prefix: "alias10", "@scope/prefix": "alias11", }, }); diff --git a/test/bundler/native-plugin.test.ts b/test/bundler/native-plugin.test.ts index 3941a57fae..fad7726630 100644 --- a/test/bundler/native-plugin.test.ts +++ b/test/bundler/native-plugin.test.ts @@ -17,19 +17,19 @@ describe("native-plugins", async () => { "plugin.cc": await Bun.file(source).text(), "not_a_plugin.cc": await Bun.file(notAPlugin).text(), "package.json": JSON.stringify({ - "name": "fake-plugin", - "module": "index.ts", - "type": "module", - "devDependencies": { + name: "fake-plugin", + module: "index.ts", + type: "module", + devDependencies: { "@types/bun": "latest", }, - "peerDependencies": { - "typescript": "^5.0.0", + peerDependencies: { + typescript: "^5.0.0", }, - "scripts": { + scripts: { "build:napi": "node-gyp configure && node-gyp build", }, - "dependencies": { + dependencies: { "node-gyp": "10.2.0", }, }), diff --git a/test/bundler/transpiler/runtime-transpiler.test.ts b/test/bundler/transpiler/runtime-transpiler.test.ts index 3334379136..4cf982599b 100644 --- a/test/bundler/transpiler/runtime-transpiler.test.ts +++ b/test/bundler/transpiler/runtime-transpiler.test.ts @@ -62,11 +62,11 @@ describe("json imports", () => { ...other } = require("./runtime-transpiler-json-fixture.json"); const obj = { - "name": "Spiral 4v4 NS", - "description": "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", - "version": "1.0", - "creator": "Grand Homie", - "players": [8, 8], + name: "Spiral 4v4 NS", + description: "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", + version: "1.0", + creator: "Grand Homie", + players: [8, 8], default: { a: 1 }, }; expect({ @@ -91,11 +91,11 @@ describe("json imports", () => { // @ts-ignore } = await import("./runtime-transpiler-json-fixture.json"); const obj = { - "name": "Spiral 4v4 NS", - "description": "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", - "version": "1.0", - "creator": "Grand Homie", - "players": [8, 8], + name: "Spiral 4v4 NS", + description: "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", + version: "1.0", + creator: "Grand Homie", + players: [8, 8], default: { a: 1 }, }; expect({ @@ -126,11 +126,11 @@ describe("json imports", () => { } = await import("./runtime-transpiler-json-fixture.json"); delete require.cache[require.resolve("./runtime-transpiler-json-fixture.json")]; const obj = { - "name": "Spiral 4v4 NS", - "description": "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", - "version": "1.0", - "creator": "Grand Homie", - "players": [8, 8], + name: "Spiral 4v4 NS", + description: "4v4 unshared map. 4 spawns in a spiral. Preferred to play with 4v4 NS.", + version: "1.0", + creator: "Grand Homie", + players: [8, 8], default: { a: 1 }, }; expect({ @@ -151,10 +151,10 @@ describe("json imports", () => { const { buildOptions, default: defaultExport } = await import("./tsconfig.with-commas.json"); delete require.cache[require.resolve("./tsconfig.with-commas.json")]; const obj = { - "buildOptions": { - "outDir": "dist", - "baseUrl": ".", - "paths": { + buildOptions: { + outDir: "dist", + baseUrl: ".", + paths: { "src/*": ["src/*"], }, }, diff --git a/test/cli/init/init.test.ts b/test/cli/init/init.test.ts index d68476dd5e..0e84d079f2 100644 --- a/test/cli/init/init.test.ts +++ b/test/cli/init/init.test.ts @@ -18,15 +18,15 @@ test("bun init works", () => { const pkg = JSON.parse(fs.readFileSync(path.join(temp, "package.json"), "utf8")); expect(pkg).toEqual({ - "name": path.basename(temp).toLowerCase(), - "module": "index.ts", - "type": "module", - "private": true, - "devDependencies": { + name: path.basename(temp).toLowerCase(), + module: "index.ts", + type: "module", + private: true, + devDependencies: { "@types/bun": "latest", }, - "peerDependencies": { - "typescript": "^5", + peerDependencies: { + typescript: "^5", }, }); const readme = fs.readFileSync(path.join(temp, "README.md"), "utf8"); @@ -55,15 +55,15 @@ test("bun init with piped cli", () => { const pkg = JSON.parse(fs.readFileSync(path.join(temp, "package.json"), "utf8")); expect(pkg).toEqual({ - "name": path.basename(temp).toLowerCase(), - "module": "index.ts", - "private": true, - "type": "module", - "devDependencies": { + name: path.basename(temp).toLowerCase(), + module: "index.ts", + private: true, + type: "module", + devDependencies: { "@types/bun": "latest", }, - "peerDependencies": { - "typescript": "^5", + peerDependencies: { + typescript: "^5", }, }); const readme = fs.readFileSync(path.join(temp, "README.md"), "utf8"); @@ -102,7 +102,7 @@ test("bun init in folder", () => { test("bun init error rather than overwriting file", async () => { const temp = tempDirWithFiles("mytmp", { - "mydir": "don't delete me!!!", + mydir: "don't delete me!!!", }); const out = Bun.spawnSync({ cmd: [bunExe(), "init", "-y", "mydir"], diff --git a/test/cli/install/bun-add.test.ts b/test/cli/install/bun-add.test.ts index 1dbec2087e..42c1e32aeb 100644 --- a/test/cli/install/bun-add.test.ts +++ b/test/cli/install/bun-add.test.ts @@ -867,7 +867,7 @@ it("should add dependency with package.json in it and http tarball", async () => stderr: "pipe", env: { ...env, - "BUN_CONFIG_TOKEN": "npm_******", + BUN_CONFIG_TOKEN: "npm_******", }, }); const err = await stderr.text(); diff --git a/test/cli/install/bun-audit.test.ts b/test/cli/install/bun-audit.test.ts index 7c8ce0ac20..7c2d5423a0 100644 --- a/test/cli/install/bun-audit.test.ts +++ b/test/cli/install/bun-audit.test.ts @@ -105,7 +105,7 @@ describe("`bun audit`", () => { name: "test", version: "1.0.0", dependencies: { - "express": "3", + express: "3", }, }), }, @@ -123,13 +123,13 @@ describe("`bun audit`", () => { version: "1.0.0", }), "bun.lock": JSON.stringify({ - "lockfileVersion": 1, - "workspaces": { + lockfileVersion: 1, + workspaces: { "": { - "name": "empty-package", + name: "empty-package", }, }, - "packages": {}, + packages: {}, }), }, fn: async ({ stdout }) => { @@ -222,13 +222,13 @@ describe("`bun audit`", () => { }, }), "bun.lock": JSON.stringify({ - "lockfileVersion": 1, - "workspaces": { + lockfileVersion: 1, + workspaces: { "": { - "name": "test", + name: "test", }, }, - "packages": { + packages: { "@foo/bar": ["@foo/bar@1.0.0", "", {}, fakeIntegrity], "@foo/baz": ["@foo/baz@1.0.0", "", {}, fakeIntegrity], }, @@ -258,28 +258,28 @@ describe("`bun audit`", () => { }), "a/package.json": JSON.stringify({ - "name": "a", - "dependencies": { - "ms": "0.7.0", + name: "a", + dependencies: { + ms: "0.7.0", }, }), "bun.lock": JSON.stringify({ - "lockfileVersion": 1, - "workspaces": { + lockfileVersion: 1, + workspaces: { "": { - "name": "bun-audit-playground", + name: "bun-audit-playground", }, - "a": { - "name": "a", - "dependencies": { - "ms": "0.7.0", + a: { + name: "a", + dependencies: { + ms: "0.7.0", }, }, }, - "packages": { - "a": ["a@workspace:a"], - "ms": ["ms@0.7.0", "", {}, fakeIntegrity], + packages: { + a: ["a@workspace:a"], + ms: ["ms@0.7.0", "", {}, fakeIntegrity], }, }), }, diff --git a/test/cli/install/bun-install-lifecycle-scripts.test.ts b/test/cli/install/bun-install-lifecycle-scripts.test.ts index 4761fc4a82..5a658d7fdd 100644 --- a/test/cli/install/bun-install-lifecycle-scripts.test.ts +++ b/test/cli/install/bun-install-lifecycle-scripts.test.ts @@ -1337,7 +1337,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { const testEnv = forceWaiterThread ? { ...env, BUN_FEATURE_FLAG_FORCE_WAITER_THREAD: "1" } : env; const scripts = { - "preinstall": `${bunExe()} -e 'Bun.sleepSync(500)'`, + preinstall: `${bunExe()} -e 'Bun.sleepSync(500)'`, }; const dependenciesList = await createPackagesWithScripts(4, scripts); @@ -1372,7 +1372,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { const testEnv = forceWaiterThread ? { ...env, BUN_FEATURE_FLAG_FORCE_WAITER_THREAD: "1" } : env; const dependenciesList = await createPackagesWithScripts(500, { - "postinstall": `${bunExe()} --version`, + postinstall: `${bunExe()} --version`, }); // the script is quick, default number for max concurrent scripts @@ -1581,7 +1581,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { name: "foo", version: "1.2.3", dependencies: { - "electron": "1.0.0", + electron: "1.0.0", }, }), ); @@ -1624,7 +1624,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { dependencies: { "uses-what-bin": "1.0.0", // fake electron package because it's in the default trustedDependencies list - "electron": "1.0.0", + electron: "1.0.0", }, }), ); @@ -1672,7 +1672,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { version: "1.2.3", dependencies: { "uses-what-bin": "1.0.0", - "electron": "1.0.0", + electron: "1.0.0", }, trustedDependencies: ["uses-what-bin"], }), @@ -1722,7 +1722,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { version: "1.2.3", dependencies: { "uses-what-bin": "1.0.0", - "electron": "1.0.0", + electron: "1.0.0", }, trustedDependencies: [], }), @@ -2322,7 +2322,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { JSON.stringify({ name: "foo", dependencies: { - "electron": "1.0.0", + electron: "1.0.0", }, }), ); @@ -2356,7 +2356,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { expect(await file(packageJson).json()).toEqual({ name: "foo", dependencies: { - "electron": "1.0.0", + electron: "1.0.0", }, }); @@ -2366,7 +2366,7 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { name: "foo", trustedDependencies: ["electron"], dependencies: { - "electron": "1.0.0", + electron: "1.0.0", }, }), ); @@ -2826,9 +2826,9 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { name: "foo", version: "1.2.3", scripts: { - "preinstall": `${exe} -e 'process.stderr.write("preinstall stderr ๐Ÿฆ\\n")'`, - "install": `${exe} -e 'process.stdout.write("install stdout ๐Ÿš€\\n")'`, - "prepare": `${exe} -e 'Bun.sleepSync(200); process.stdout.write("prepare stdout done โœ…\\n")'`, + preinstall: `${exe} -e 'process.stderr.write("preinstall stderr ๐Ÿฆ\\n")'`, + install: `${exe} -e 'process.stdout.write("install stdout ๐Ÿš€\\n")'`, + prepare: `${exe} -e 'Bun.sleepSync(200); process.stdout.write("prepare stdout done โœ…\\n")'`, }, }), ); @@ -2876,9 +2876,9 @@ for (const forceWaiterThread of isLinux ? [false, true] : [false]) { name: "foo", version: "1.2.3", scripts: { - "preinstall": `${exe} -e 'process.stderr.write("preinstall stderr ๐Ÿฆ\\n")'`, - "install": `${exe} -e 'process.stdout.write("install stdout ๐Ÿš€\\n")'`, - "prepare": `${exe} -e 'Bun.sleepSync(200); process.stdout.write("prepare stdout done โœ…\\n")'`, + preinstall: `${exe} -e 'process.stderr.write("preinstall stderr ๐Ÿฆ\\n")'`, + install: `${exe} -e 'process.stdout.write("install stdout ๐Ÿš€\\n")'`, + prepare: `${exe} -e 'Bun.sleepSync(200); process.stdout.write("prepare stdout done โœ…\\n")'`, }, dependencies: { "no-deps": "1.0.0", diff --git a/test/cli/install/bun-install-patch.test.ts b/test/cli/install/bun-install-patch.test.ts index 213725b22b..3963d5806f 100644 --- a/test/cli/install/bun-install-patch.test.ts +++ b/test/cli/install/bun-install-patch.test.ts @@ -123,13 +123,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test(version, async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-even@${patchVersion}`]: `patches/${patchFilename}`, }, - "dependencies": { + dependencies: { "is-even": version, "is-odd": "3.0.1", }, @@ -151,13 +151,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test("should patch a non-hoisted dependency", async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-odd@0.1.2`]: `patches/is-odd@0.1.2.patch`, }, - "dependencies": { + dependencies: { "is-even": "1.0.0", "is-odd": "3.0.1", }, @@ -181,13 +181,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test(version, async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-even@${patchVersion}`]: `patches/${patchFilename}`, }, - "dependencies": { + dependencies: { "is-even": version, }, }), @@ -210,13 +210,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 const patchFilename = filepathEscape(`is-odd@${version}.patch`); const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-odd@${version}`]: `patches/${patchFilename}`, }, - "dependencies": { + dependencies: { "is-even": "1.0.0", }, }), @@ -239,10 +239,10 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test(version, async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": version, }, }), @@ -257,13 +257,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 await $`${bunExe()} i`.env(bunEnv).cwd(filedir); await $`echo ${JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-even@${patchVersion}`]: `patches/${patchfileName}`, }, - "dependencies": { + dependencies: { "is-even": version, }, })} > package.json` @@ -282,10 +282,10 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 it("should patch a transitive dependency after it was already installed", async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -300,13 +300,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 await $`${bunExe()} i`.env(bunEnv).cwd(filedir); await $`echo ${JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { "is-odd@0.1.2": "patches/is-odd@0.1.2.patch", }, - "dependencies": { + dependencies: { "is-even": "1.0.0", }, })} > package.json` @@ -328,13 +328,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test(version, async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-even@${patchVersion}`]: `patches/${patchFilename}`, }, - "dependencies": { + dependencies: { "is-even": version, }, }), @@ -362,13 +362,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 test(version, async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-even@${patchVersion}`]: `patches/${patchFilename}`, }, - "dependencies": { + dependencies: { "is-even": version, }, }), @@ -383,13 +383,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 await $`${bunExe()} i`.env(bunEnv).cwd(filedir); await $`echo ${JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { [`is-odd@0.1.2`]: `patches/is-odd@0.1.2.patch`, }, - "dependencies": { + dependencies: { "is-even": version, }, })} > package.json` @@ -410,13 +410,13 @@ index c8950c17b265104bcf27f8c345df1a1b13a78950..7ce57ab96400ab0ff4fac7e06f6e02c2 $.throws(true); const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { "is-odd@0.1.2": "patches/is-odd@0.1.2.patch", }, - "dependencies": { + dependencies: { "is-even": "1.0.0", }, }), @@ -464,13 +464,13 @@ index aa7c7012cda790676032d1b01d78c0b69ec06360..6048e7cb462b3f9f6ac4dc21aacf9a09 $.throws(true); const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { "@zackradisic/hls-dl@0.0.1": "patches/thepatch.patch", }, - "dependencies": { + dependencies: { "@zackradisic/hls-dl": "0.0.1", }, }), @@ -503,10 +503,10 @@ index 832d92223a9ec491364ee10dcbe3ad495446ab80..7e079a817825de4b8c3d01898490dc7e const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -519,13 +519,13 @@ index 832d92223a9ec491364ee10dcbe3ad495446ab80..7e079a817825de4b8c3d01898490dc7e await $`${bunExe()} i`.env(bunEnv).cwd(filedir); const pkgjsonWithPatch = { - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "patchedDependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + patchedDependencies: { "is-even@1.0.0": "patches/is-even@1.0.0.patch", }, - "dependencies": { + dependencies: { "is-even": "1.0.0", }, }; diff --git a/test/cli/install/bun-install-pathname-trailing-slash.test.ts b/test/cli/install/bun-install-pathname-trailing-slash.test.ts index 5f6e4b43db..adf2d4551b 100644 --- a/test/cli/install/bun-install-pathname-trailing-slash.test.ts +++ b/test/cli/install/bun-install-pathname-trailing-slash.test.ts @@ -34,7 +34,7 @@ registry = "http://${hostname}:${port}/prefixed-route/" name: "test", version: "0.0.0", dependencies: { - "react": "my-custom-tag", + react: "my-custom-tag", }, }), ); diff --git a/test/cli/install/bun-install-proxy.test.ts b/test/cli/install/bun-install-proxy.test.ts index 00d11cd18a..f3bec0d0c3 100644 --- a/test/cli/install/bun-install-proxy.test.ts +++ b/test/cli/install/bun-install-proxy.test.ts @@ -59,23 +59,23 @@ if (isDockerEnabled()) { it("bun install with proxy with big packages", async () => { const files = { "package.json": JSON.stringify({ - "name": "test-install", - "module": "index.ts", - "type": "module", - "private": true, - "dependencies": { - "gastby": "1.0.1", - "mitata": "1.0.34", + name: "test-install", + module: "index.ts", + type: "module", + private: true, + dependencies: { + gastby: "1.0.1", + mitata: "1.0.34", "next.js": "1.0.3", - "react": "19.1.0", + react: "19.1.0", "react-dom": "19.1.0", "@types/react": "18.3.3", - "esbuild": "0.21.4", - "peechy": "0.4.34", - "prettier": "3.5.3", + esbuild: "0.21.4", + peechy: "0.4.34", + prettier: "3.5.3", "prettier-plugin-organize-imports": "4.0.0", "source-map-js": "1.2.0", - "typescript": "5.7.2", + typescript: "5.7.2", }, }), }; diff --git a/test/cli/install/bun-install-registry.test.ts b/test/cli/install/bun-install-registry.test.ts index 0310cde1f2..19e6f17bb2 100644 --- a/test/cli/install/bun-install-registry.test.ts +++ b/test/cli/install/bun-install-registry.test.ts @@ -230,7 +230,7 @@ describe("certificate authority", () => { expect(await exited).toBe(0); }); test(`non-existent --cafile`, async () => { - await write(packageJson, JSON.stringify({ name: "foo", version: "1.0.0", "dependencies": { "no-deps": "1.1.1" } })); + await write(packageJson, JSON.stringify({ name: "foo", version: "1.0.0", dependencies: { "no-deps": "1.1.1" } })); const { stdout, stderr, exited } = spawn({ cmd: [bunExe(), "install", "--cafile", "does-not-exist"], @@ -247,7 +247,7 @@ describe("certificate authority", () => { }); test("non-existent --cafile (absolute path)", async () => { - await write(packageJson, JSON.stringify({ name: "foo", version: "1.0.0", "dependencies": { "no-deps": "1.1.1" } })); + await write(packageJson, JSON.stringify({ name: "foo", version: "1.0.0", dependencies: { "no-deps": "1.1.1" } })); const { stdout, stderr, exited } = spawn({ cmd: [bunExe(), "install", "--cafile", "/does/not/exist"], cwd: packageDir, @@ -1219,7 +1219,7 @@ describe("optionalDependencies", () => { "missing-tarball": "1.0.0", "uses-what-bin": "1.0.0", }, - "trustedDependencies": ["uses-what-bin"], + trustedDependencies: ["uses-what-bin"], }), ); @@ -1647,7 +1647,7 @@ test("hardlinks on windows dont fail with long paths", async () => { version: "1.2.3", dependencies: { // 255 characters - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: "file:./a-package", }, }), @@ -2247,7 +2247,7 @@ test("--production excludes devDependencies in workspaces", async () => { "no-deps": "1.0.0", }, devDependencies: { - "a1": "npm:no-deps@1.0.0", + a1: "npm:no-deps@1.0.0", }, }), ), @@ -2259,7 +2259,7 @@ test("--production excludes devDependencies in workspaces", async () => { "a-dep": "1.0.2", }, devDependencies: { - "a2": "npm:a-dep@1.0.2", + a2: "npm:a-dep@1.0.2", }, }), ), @@ -2268,9 +2268,9 @@ test("--production excludes devDependencies in workspaces", async () => { JSON.stringify({ name: "pkg2", devDependencies: { - "a3": "npm:a-dep@1.0.3", - "a4": "npm:a-dep@1.0.4", - "a5": "npm:a-dep@1.0.5", + a3: "npm:a-dep@1.0.3", + a4: "npm:a-dep@1.0.4", + a5: "npm:a-dep@1.0.5", }, }), ), @@ -2943,7 +2943,7 @@ describe("binaries", () => { name: "fooooo", version: "2.2.2", dependencies: { - "fooooo": ".", + fooooo: ".", "no-deps": "1.0.0", }, bin: "fooooo.js", @@ -2953,18 +2953,18 @@ describe("binaries", () => { write( join(packageDir, "bun.lock"), JSON.stringify({ - "lockfileVersion": 0, - "workspaces": { + lockfileVersion: 0, + workspaces: { "": { - "name": "fooooo", - "dependencies": { - "fooooo": ".", + name: "fooooo", + dependencies: { + fooooo: ".", // out of date, no no-deps }, }, }, - "packages": { - "fooooo": ["fooooo@root:", { bin: "fooooo.js" }], + packages: { + fooooo: ["fooooo@root:", { bin: "fooooo.js" }], }, }), ), @@ -3199,7 +3199,7 @@ test("it should install with missing bun.lockb, node_modules, and/or cache", asy "one-fixed-dep": "2.0.0", "no-deps-bins": "2.0.0", "left-pad": "1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "3.0.0", "dev-deps": "1.0.0", @@ -4160,8 +4160,8 @@ describe("hoisting", async () => { join(packageDir, "node_modules", "normal-dep-and-dev-dep", "node_modules", "no-deps", "package.json"), ).json(), ).toEqual({ - "name": "no-deps", - "version": "1.1.0", + name: "no-deps", + version: "1.1.0", }); expect( await file(join(packageDir, "node_modules", "folder-dep", "node_modules", "no-deps", "package.json")).json(), @@ -4324,9 +4324,9 @@ describe("transitive file dependencies", () => { [], true, { - "name": "files", - "version": "1.1.1", - "dependencies": { + name: "files", + version: "1.1.1", + dependencies: { "no-deps": "2.0.0", }, }, @@ -4826,8 +4826,8 @@ describe("transitive file dependencies", () => { version: "1.0.0", dependencies: { // without and without file protocol - "pkg0": `file:${resolve(packageDir, "pkg0").replace(/\\/g, "\\\\")}`, - "pkg1": `${resolve(packageDir, "pkg1").replace(/\\/g, "\\\\")}`, + pkg0: `file:${resolve(packageDir, "pkg0").replace(/\\/g, "\\\\")}`, + pkg1: `${resolve(packageDir, "pkg1").replace(/\\/g, "\\\\")}`, }, }), ); @@ -5085,21 +5085,21 @@ describe("update", () => { JSON.stringify({ name: "foo", dependencies: { - "a1": "npm:no-deps@1", - "a10": "npm:no-deps@~1.0", - "a11": "npm:no-deps@^1.0", - "a12": "npm:no-deps@~1.0.1", - "a13": "npm:no-deps@^1.0.1", - "a14": "npm:no-deps@~1.1.0", - "a15": "npm:no-deps@^1.1.0", - "a2": "npm:no-deps@1.0", - "a3": "npm:no-deps@1.1", - "a4": "npm:no-deps@1.0.1", - "a5": "npm:no-deps@1.1.0", - "a6": "npm:no-deps@~1", - "a7": "npm:no-deps@^1", - "a8": "npm:no-deps@~1.1", - "a9": "npm:no-deps@^1.1", + a1: "npm:no-deps@1", + a10: "npm:no-deps@~1.0", + a11: "npm:no-deps@^1.0", + a12: "npm:no-deps@~1.0.1", + a13: "npm:no-deps@^1.0.1", + a14: "npm:no-deps@~1.1.0", + a15: "npm:no-deps@^1.1.0", + a2: "npm:no-deps@1.0", + a3: "npm:no-deps@1.1", + a4: "npm:no-deps@1.0.1", + a5: "npm:no-deps@1.1.0", + a6: "npm:no-deps@~1", + a7: "npm:no-deps@^1", + a8: "npm:no-deps@~1.1", + a9: "npm:no-deps@^1.1", }, }), ); @@ -5111,21 +5111,21 @@ describe("update", () => { expect(await file(packageJson).json()).toEqual({ name: "foo", dependencies: { - "a1": "npm:no-deps@^2.0.0", - "a10": "npm:no-deps@~2.0.0", - "a11": "npm:no-deps@^2.0.0", - "a12": "npm:no-deps@~2.0.0", - "a13": "npm:no-deps@^2.0.0", - "a14": "npm:no-deps@~2.0.0", - "a15": "npm:no-deps@^2.0.0", - "a2": "npm:no-deps@~2.0.0", - "a3": "npm:no-deps@~2.0.0", - "a4": "npm:no-deps@2.0.0", - "a5": "npm:no-deps@2.0.0", - "a6": "npm:no-deps@~2.0.0", - "a7": "npm:no-deps@^2.0.0", - "a8": "npm:no-deps@~2.0.0", - "a9": "npm:no-deps@^2.0.0", + a1: "npm:no-deps@^2.0.0", + a10: "npm:no-deps@~2.0.0", + a11: "npm:no-deps@^2.0.0", + a12: "npm:no-deps@~2.0.0", + a13: "npm:no-deps@^2.0.0", + a14: "npm:no-deps@~2.0.0", + a15: "npm:no-deps@^2.0.0", + a2: "npm:no-deps@~2.0.0", + a3: "npm:no-deps@~2.0.0", + a4: "npm:no-deps@2.0.0", + a5: "npm:no-deps@2.0.0", + a6: "npm:no-deps@~2.0.0", + a7: "npm:no-deps@^2.0.0", + a8: "npm:no-deps@~2.0.0", + a9: "npm:no-deps@^2.0.0", }, }); } else { @@ -5135,21 +5135,21 @@ describe("update", () => { expect(await file(packageJson).json()).toEqual({ name: "foo", dependencies: { - "a1": "npm:no-deps@^1.1.0", - "a10": "npm:no-deps@~1.0.1", - "a11": "npm:no-deps@^1.1.0", - "a12": "npm:no-deps@~1.0.1", - "a13": "npm:no-deps@^1.1.0", - "a14": "npm:no-deps@~1.1.0", - "a15": "npm:no-deps@^1.1.0", - "a2": "npm:no-deps@~1.0.1", - "a3": "npm:no-deps@~1.1.0", - "a4": "npm:no-deps@1.0.1", - "a5": "npm:no-deps@1.1.0", - "a6": "npm:no-deps@~1.1.0", - "a7": "npm:no-deps@^1.1.0", - "a8": "npm:no-deps@~1.1.0", - "a9": "npm:no-deps@^1.1.0", + a1: "npm:no-deps@^1.1.0", + a10: "npm:no-deps@~1.0.1", + a11: "npm:no-deps@^1.1.0", + a12: "npm:no-deps@~1.0.1", + a13: "npm:no-deps@^1.1.0", + a14: "npm:no-deps@~1.1.0", + a15: "npm:no-deps@^1.1.0", + a2: "npm:no-deps@~1.0.1", + a3: "npm:no-deps@~1.1.0", + a4: "npm:no-deps@1.0.1", + a5: "npm:no-deps@1.1.0", + a6: "npm:no-deps@~1.1.0", + a7: "npm:no-deps@^1.1.0", + a8: "npm:no-deps@~1.1.0", + a9: "npm:no-deps@^1.1.0", }, }); } @@ -5475,7 +5475,7 @@ describe("update", () => { "one-fixed-dep": "^1.0.0", "no-deps-bins": "^2.0.0", "left-pad": "^1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "^2.0.0", "dev-deps": "1.0.0", @@ -5496,7 +5496,7 @@ describe("update", () => { "one-fixed-dep": "^1.0.0", "no-deps-bins": "^2.0.0", "left-pad": "^1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "^2.0.0", "dev-deps": "1.0.0", @@ -5549,7 +5549,7 @@ describe("update", () => { "one-fixed-dep": "^1.0.0", "no-deps-bins": "^2.0.0", "left-pad": "^1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "^2.0.1", "dev-deps": "1.0.0", @@ -5589,7 +5589,7 @@ describe("update", () => { "one-fixed-dep": "^1.0.0", "no-deps-bins": "^2.0.0", "left-pad": "^1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "^2.0.0", "dev-deps": "1.0.0", @@ -5636,7 +5636,7 @@ describe("update", () => { "one-fixed-dep": "^1.0.0", "no-deps-bins": "^2.0.0", "left-pad": "^1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "^2.0.0", "dev-deps": "1.0.0", @@ -5707,7 +5707,7 @@ describe("update", () => { JSON.stringify({ name: "pkg2", dependencies: { - "pkg1": "*", + pkg1: "*", "is-number": "*", }, }), @@ -6060,7 +6060,7 @@ test("missing package on reinstall, some with binaries", async () => { "one-fixed-dep": "2.0.0", "no-deps-bins": "2.0.0", "left-pad": "1.0.0", - "native": "1.0.0", + native: "1.0.0", "dep-loop-entry": "1.0.0", "dep-with-tags": "3.0.0", "dev-deps": "1.0.0", @@ -6503,30 +6503,29 @@ describe("semver", () => { test("doesn't error when the migration is out of sync", async () => { const cwd = tempDirWithFiles("out-of-sync-1", { "package.json": JSON.stringify({ - "devDependencies": { + devDependencies: { "no-deps": "1.0.0", }, }), "package-lock.json": JSON.stringify({ - "name": "reproo", - "lockfileVersion": 3, - "requires": true, - "packages": { + name: "reproo", + lockfileVersion: 3, + requires: true, + packages: { "": { - "name": "reproo", - "dependencies": { + name: "reproo", + dependencies: { "no-deps": "2.0.0", }, - "devDependencies": { + devDependencies: { "no-deps": "1.0.0", }, }, "node_modules/no-deps": { - "version": "1.0.0", - "resolved": `http://localhost:${port}/no-deps/-/no-deps-1.0.0.tgz`, - "integrity": - "sha512-v4w12JRjUGvfHDUP8vFDwu0gUWu04j0cv9hLb1Abf9VdaXu4XcrddYFTMVBVvmldKViGWH7jrb6xPJRF0wq6gw==", - "dev": true, + version: "1.0.0", + resolved: `http://localhost:${port}/no-deps/-/no-deps-1.0.0.tgz`, + integrity: "sha512-v4w12JRjUGvfHDUP8vFDwu0gUWu04j0cv9hLb1Abf9VdaXu4XcrddYFTMVBVvmldKViGWH7jrb6xPJRF0wq6gw==", + dev: true, }, }, }), @@ -7030,9 +7029,9 @@ describe("yarn tests", () => { await writeFile( packageJson, JSON.stringify({ - "name": "dragon-test-4", - "version": "1.0.0", - "workspaces": ["my-workspace"], + name: "dragon-test-4", + version: "1.0.0", + workspaces: ["my-workspace"], }), ); @@ -7040,13 +7039,13 @@ describe("yarn tests", () => { await writeFile( join(packageDir, "my-workspace", "package.json"), JSON.stringify({ - "name": "my-workspace", - "version": "1.0.0", - "peerDependencies": { + name: "my-workspace", + version: "1.0.0", + peerDependencies: { "no-deps": "*", "peer-deps": "*", }, - "devDependencies": { + devDependencies: { "no-deps": "1.0.0", "peer-deps": "1.0.0", }, @@ -7092,9 +7091,9 @@ describe("yarn tests", () => { await writeFile( packageJson, JSON.stringify({ - "name": "dragon-test-5", - "version": "1.0.0", - "workspaces": ["packages/*"], + name: "dragon-test-5", + version: "1.0.0", + workspaces: ["packages/*"], }), ); @@ -7104,11 +7103,11 @@ describe("yarn tests", () => { await writeFile( join(packageDir, "packages", "a", "package.json"), JSON.stringify({ - "name": "a", - "peerDependencies": { + name: "a", + peerDependencies: { "various-requires": "*", }, - "devDependencies": { + devDependencies: { "no-deps": "1.0.0", "peer-deps": "1.0.0", }, @@ -7118,9 +7117,9 @@ describe("yarn tests", () => { await writeFile( join(packageDir, "packages", "b", "package.json"), JSON.stringify({ - "name": "b", - "devDependencies": { - "a": "workspace:*", + name: "b", + devDependencies: { + a: "workspace:*", "various-requires": "1.0.0", }, }), @@ -7175,9 +7174,9 @@ describe("yarn tests", () => { await writeFile( packageJson, JSON.stringify({ - "name": "dragon-test-6", - "version": "1.0.0", - "workspaces": ["packages/*"], + name: "dragon-test-6", + version: "1.0.0", + workspaces: ["packages/*"], }), ); @@ -7292,9 +7291,9 @@ describe("yarn tests", () => { await writeFile( packageJson, JSON.stringify({ - "name": "dragon-test-7", - "version": "1.0.0", - "dependencies": { + name: "dragon-test-7", + version: "1.0.0", + dependencies: { "dragon-test-7-a": "1.0.0", "dragon-test-7-d": "1.0.0", "dragon-test-7-b": "2.0.0", @@ -7375,7 +7374,7 @@ describe("yarn tests", () => { await writeFile( packageJson, JSON.stringify({ - "name": "dragon-test-8", + name: "dragon-test-8", version: "1.0.0", dependencies: { "dragon-test-8-a": "1.0.0", @@ -8108,8 +8107,8 @@ test("tarball `./` prefix, duplicate directory with file, and empty directory", "ooooops", "oooooops", { - "name": "tarball-without-package-prefix", - "version": "2.0.0", + name: "tarball-without-package-prefix", + version: "2.0.0", }, false, false, diff --git a/test/cli/install/bun-install.test.ts b/test/cli/install/bun-install.test.ts index 516e71db0b..739b5ba96f 100644 --- a/test/cli/install/bun-install.test.ts +++ b/test/cli/install/bun-install.test.ts @@ -445,10 +445,10 @@ registry = "https://badssl.com:bad" it("should work when moving workspace packages", async () => { const package_dir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -459,18 +459,18 @@ it("should work when moving workspace packages", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", private: "true", }), }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -491,10 +491,10 @@ it("should work when moving workspace packages", async () => { # change workspaces from "packages/*" to "config/*" echo ${JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", version: "0.0.1", workspaces: ["config/*"], - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -517,10 +517,10 @@ it("should work when moving workspace packages", async () => { it("should work when renaming a single workspace package", async () => { const package_dir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -531,18 +531,18 @@ it("should work when renaming a single workspace package", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", private: "true", }), }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -560,10 +560,10 @@ it("should work when renaming a single workspace package", async () => { await Bun.$ /* sh */ ` echo ${JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", version: "0.0.1", workspaces: ["packages/*"], - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config-lol": "*", "@repo/typescript-config": "*", @@ -572,7 +572,7 @@ it("should work when renaming a single workspace package", async () => { echo ${JSON.stringify({ name: "@repo/eslint-config-lol", - "version": "0.0.0", + version: "0.0.0", private: "true", })} > packages/eslint-config/package.json @@ -2944,7 +2944,7 @@ it("should get npm alias with matching version", async () => { version: "0.0.1", workspaces: ["moo"], dependencies: { - "boba": "npm:baz@0.0.5", + boba: "npm:baz@0.0.5", }, }), ); @@ -3007,7 +3007,7 @@ it("should not apply overrides to package name of aliased package", async () => bar: "npm:baz@0.0.3", }, overrides: { - "baz": "0.0.5", + baz: "0.0.5", }, }), ); @@ -3179,7 +3179,7 @@ it("should handle aliased dependency with existing lockfile", async () => { name: "foo", version: "0.0.1", dependencies: { - "moz": "npm:@barn/moo@0.1.0", + moz: "npm:@barn/moo@0.1.0", }, }), ); @@ -4827,7 +4827,7 @@ it("should fail on ssh Git URL if invalid credentials", async () => { stdout: "pipe", stdin: "ignore", stderr: "pipe", - env: { ...env, "GIT_ASKPASS": "echo" }, + env: { ...env, GIT_ASKPASS: "echo" }, }); const err = await stderr.text(); expect(err.split(/\r?\n/)).toContain('error: "git clone" for "private-install" failed'); @@ -6316,9 +6316,9 @@ it("should perform bin-linking across multiple dependencies", async () => { name: "foo", devDependencies: { "conditional-type-checks": "1.0.6", - "prettier": "2.8.8", - "tsd": "0.22.0", - "typescript": "5.0.4", + prettier: "2.8.8", + tsd: "0.22.0", + typescript: "5.0.4", }, }); await writeFile(join(package_dir, "package.json"), foo_package); @@ -6929,36 +6929,36 @@ it("should handle installing workspaces with more complicated globs", async () = version: "0.0.1", workspaces: ["packages/**/*"], }), - "packages": { - "frontend": { + packages: { + frontend: { "package.json": JSON.stringify({ name: "frontend", version: "0.0.1", dependencies: { - "types": "workspace:*", - "components": "workspace:*", + types: "workspace:*", + components: "workspace:*", }, }), - "components": { + components: { "package.json": JSON.stringify({ name: "components", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, }, - "backend": { + backend: { "package.json": JSON.stringify({ name: "backend", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, - "types": { + types: { "package.json": JSON.stringify({ name: "types", version: "0.0.1", @@ -6986,40 +6986,40 @@ it("should handle installing workspaces with multiple glob patterns", async () = version: "0.0.1", workspaces: ["backend/**/*", "client/**/*", "types/**/*"], }), - "backend": { - "server": { + backend: { + server: { "package.json": JSON.stringify({ name: "server", version: "0.0.1", dependencies: { - "types": "workspace:*", - "db": "workspace:*", + types: "workspace:*", + db: "workspace:*", }, }), }, - "db": { + db: { "package.json": JSON.stringify({ name: "db", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, }, - "client": { - "clientlib": { + client: { + clientlib: { "package.json": JSON.stringify({ name: "clientlib", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, }, - "types": { - "types": { + types: { + types: { "package.json": JSON.stringify({ name: "types", version: "0.0.1", @@ -7050,36 +7050,36 @@ it.todo("should handle installing workspaces with absolute glob patterns", async version: "0.0.1", workspaces: [join(base, "packages/**/*")], }), - "packages": { - "frontend": { + packages: { + frontend: { "package.json": JSON.stringify({ name: "frontend", version: "0.0.1", dependencies: { - "types": "workspace:*", - "components": "workspace:*", + types: "workspace:*", + components: "workspace:*", }, }), - "components": { + components: { "package.json": JSON.stringify({ name: "components", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, }, - "backend": { + backend: { "package.json": JSON.stringify({ name: "backend", version: "0.0.1", dependencies: { - "types": "workspace:*", + types: "workspace:*", }, }), }, - "types": { + types: { "package.json": JSON.stringify({ name: "types", version: "0.0.1", @@ -8369,23 +8369,23 @@ it("should handle modified git resolutions in bun.lock", async () => { name: "foo", version: "0.0.1", dependencies: { - "jquery": "3.7.1", + jquery: "3.7.1", }, }), ), write( join(package_dir, "bun.lock"), JSON.stringify({ - "lockfileVersion": 0, - "workspaces": { + lockfileVersion: 0, + workspaces: { "": { - "dependencies": { - "jquery": "3.7.1", + dependencies: { + jquery: "3.7.1", }, }, }, - "packages": { - "jquery": [ + packages: { + jquery: [ "jquery@git+ssh://git@github.com/dylan-conway/install-test-8.git#3a1288830817d13da39e9231302261896f8721ea", {}, "3a1288830817d13da39e9231302261896f8721ea", @@ -8472,22 +8472,22 @@ test("providing invalid url in lockfile does not crash", async () => { join(package_dir, "package.json"), JSON.stringify({ dependencies: { - "jquery": "3.7.1", + jquery: "3.7.1", }, }), ), write( join(package_dir, "bun.lock"), textLockfile(0, { - "workspaces": { + workspaces: { "": { - "dependencies": { - "jquery": "3.7.1", + dependencies: { + jquery: "3.7.1", }, }, }, - "packages": { - "jquery": [ + packages: { + jquery: [ "jquery@3.7.1", "invalid-url", {}, @@ -8525,14 +8525,14 @@ test("optional dependencies do not need to be resolvable in text lockfile", asyn write( join(package_dir, "bun.lock"), textLockfile(0, { - "workspaces": { + workspaces: { "": { - "optionalDependencies": { - "jquery": "3.7.1", + optionalDependencies: { + jquery: "3.7.1", }, }, }, - "packages": {}, + packages: {}, }), ), ]); @@ -8569,7 +8569,7 @@ test("non-optional dependencies need to be resolvable in text lockfile", async ( workspaces: { "": { dependencies: { - "jquery": "3.7.1", + jquery: "3.7.1", }, }, }, diff --git a/test/cli/install/bun-lock.test.ts b/test/cli/install/bun-lock.test.ts index d08c3c376f..d3106d39bb 100644 --- a/test/cli/install/bun-lock.test.ts +++ b/test/cli/install/bun-lock.test.ts @@ -176,7 +176,7 @@ it("should convert a binary lockfile with invalid optional peers", async () => { JSON.stringify({ name: "pkg1", dependencies: { - "langchain": "^0.0.194", + langchain: "^0.0.194", }, }), ), @@ -601,7 +601,7 @@ it("should include unused resolutions in the lockfile", async () => { "no-deps": "2.0.0", // unused resolution - "jquery": "4.0.0", + jquery: "4.0.0", }, }; diff --git a/test/cli/install/bun-pack.test.ts b/test/cli/install/bun-pack.test.ts index 59b5044be9..f452736680 100644 --- a/test/cli/install/bun-pack.test.ts +++ b/test/cli/install/bun-pack.test.ts @@ -48,7 +48,7 @@ test("basic", async () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-basic-1.2.3.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/index.js" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/index.js" }]); }); test("in subdirectory", async () => { @@ -69,9 +69,9 @@ test("in subdirectory", async () => { const first = readTarball(join(packageDir, "pack-from-subdir-7.7.7.tgz")); expect(first.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/root.js" }, - { "pathname": "package/subdir1/subdir2/index.js" }, + { pathname: "package/package.json" }, + { pathname: "package/root.js" }, + { pathname: "package/subdir1/subdir2/index.js" }, ]); await rm(join(packageDir, "pack-from-subdir-7.7.7.tgz")); @@ -254,13 +254,13 @@ describe("flags", () => { const destinationTests = [ { - "path": "", + path: "", }, { - "path": "dest-dir", + path: "dest-dir", }, { - "path": "more/dir", + path: "more/dir", }, ]; @@ -442,10 +442,10 @@ test("shasum and integrity are consistent", async () => { const tarball = readTarball(join(packageDir, "pack-shasum-1.1.1.tgz")); expect(tarball.entries).toMatchObject([ { - "pathname": "package/package.json", + pathname: "package/package.json", }, { - "pathname": "package/index.js", + pathname: "package/index.js", }, ]); @@ -458,10 +458,10 @@ test("shasum and integrity are consistent", async () => { const secondTarball = readTarball(join(packageDir, "pack-shasum-1.1.1.tgz")); expect(secondTarball.entries).toMatchObject([ { - "pathname": "package/package.json", + pathname: "package/package.json", }, { - "pathname": "package/index.js", + pathname: "package/index.js", }, ]); @@ -491,7 +491,7 @@ describe("workspaces", () => { await pack(join(packageDir, "pkgs", "pkg1"), bunEnv); const tarball = readTarball(join(packageDir, "pkgs", "pkg1", "pkg1-1.1.1.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/index.js" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/index.js" }]); }); test("in a workspace subdirectory", async () => { await createBasicWorkspace(); @@ -500,7 +500,7 @@ describe("workspaces", () => { await pack(join(packageDir, "pkgs", "pkg1", "subdir"), bunEnv); const tarball = readTarball(join(packageDir, "pkgs", "pkg1", "pkg1-1.1.1.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/index.js" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/index.js" }]); }); test("replaces workspace: protocol without lockfile", async () => { await Promise.all([ @@ -511,7 +511,7 @@ describe("workspaces", () => { version: "2.3.4", workspaces: ["pkgs/*"], dependencies: { - "pkg1": "workspace:1.1.1", + pkg1: "workspace:1.1.1", }, }), ), @@ -523,16 +523,16 @@ describe("workspaces", () => { const tarball = readTarball(join(packageDir, "pack-workspace-protocol-2.3.4.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/pkgs/pkg1/package.json" }, - { "pathname": "package/root.js" }, + { pathname: "package/package.json" }, + { pathname: "package/pkgs/pkg1/package.json" }, + { pathname: "package/root.js" }, ]); expect(JSON.parse(tarball.entries[0].contents)).toEqual({ name: "pack-workspace-protocol", version: "2.3.4", workspaces: ["pkgs/*"], dependencies: { - "pkg1": "1.1.1", + pkg1: "1.1.1", }, }); }); @@ -556,7 +556,7 @@ describe("workspaces", () => { version: "2.5.6", workspaces: ["pkgs/*"], dependencies: { - "pkg1": input, + pkg1: input, }, }), ), @@ -569,16 +569,16 @@ describe("workspaces", () => { const tarball = readTarball(join(packageDir, "pack-workspace-protocol-with-lockfile-2.5.6.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/pkgs/pkg1/package.json" }, - { "pathname": "package/root.js" }, + { pathname: "package/package.json" }, + { pathname: "package/pkgs/pkg1/package.json" }, + { pathname: "package/root.js" }, ]); expect(JSON.parse(tarball.entries[0].contents)).toEqual({ name: "pack-workspace-protocol-with-lockfile", version: "2.5.6", workspaces: ["pkgs/*"], dependencies: { - "pkg1": expected, + pkg1: expected, }, }); }); @@ -593,7 +593,7 @@ describe("workspaces", () => { version: "2.2.3", workspaces: ["pkgs/*"], dependencies: { - "pkg1": "workspace:*", + pkg1: "workspace:*", }, }), ), @@ -610,9 +610,9 @@ describe("workspaces", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-workspace-protocol-fail-2.2.3.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/pkgs/pkg1/package.json" }, - { "pathname": "package/root.js" }, + { pathname: "package/package.json" }, + { pathname: "package/pkgs/pkg1/package.json" }, + { pathname: "package/root.js" }, ]); }); }); @@ -645,10 +645,10 @@ tarball: \${fs.existsSync("pack-lifecycle-order-1.1.1.tgz")}\`)`; const tarball = readTarball(join(packageDir, "pack-lifecycle-order-1.1.1.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/prepack.txt" }, - { "pathname": "package/prepare.txt" }, - { "pathname": "package/script.js" }, + { pathname: "package/package.json" }, + { pathname: "package/prepack.txt" }, + { pathname: "package/prepare.txt" }, + { pathname: "package/script.js" }, ]); const results = await Promise.all([ @@ -674,7 +674,7 @@ describe("bundledDependnecies", () => { name: "pack-bundled", version: "4.4.4", dependencies: { - "dep1": "1.1.1", + dep1: "1.1.1", }, [bundledDependencies]: ["dep1"], }), @@ -692,8 +692,8 @@ describe("bundledDependnecies", () => { const tarball = readTarball(join(packageDir, "pack-bundled-4.4.4.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/node_modules/dep1/package.json" }, + { pathname: "package/package.json" }, + { pathname: "package/node_modules/dep1/package.json" }, ]); }); } @@ -706,10 +706,10 @@ describe("bundledDependnecies", () => { name: "pack-bundled", version: "4.4.4", dependencies: { - "dep1": "1.1.1", + dep1: "1.1.1", }, devDependencies: { - "dep2": "1.1.1", + dep2: "1.1.1", }, bundledDependencies: true, }), @@ -734,8 +734,8 @@ describe("bundledDependnecies", () => { const tarball = readTarball(join(packageDir, "pack-bundled-4.4.4.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/node_modules/dep1/package.json" }, + { pathname: "package/package.json" }, + { pathname: "package/node_modules/dep1/package.json" }, ]); }); @@ -765,8 +765,8 @@ describe("bundledDependnecies", () => { const tarball = readTarball(join(packageDir, "pack-bundled-4.4.4.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/node_modules/@oven/bun/package.json" }, + { pathname: "package/package.json" }, + { pathname: "package/node_modules/@oven/bun/package.json" }, ]); }); @@ -853,10 +853,10 @@ describe("bundledDependnecies", () => { const tarball = readTarball(join(packageDir, "pack-resolved-bundled-dep-5.5.5.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/node_modules/dep1/node_modules/dep3/package.json" }, - { "pathname": "package/node_modules/dep1/package.json" }, - { "pathname": "package/node_modules/dep2/package.json" }, + { pathname: "package/package.json" }, + { pathname: "package/node_modules/dep1/node_modules/dep3/package.json" }, + { pathname: "package/node_modules/dep1/package.json" }, + { pathname: "package/node_modules/dep2/package.json" }, ]); }); @@ -906,10 +906,10 @@ describe("bundledDependnecies", () => { const tarball = readTarball(join(packageDir, "pack-resolve-scoped-6.6.6.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/node_modules/@scoped/dep1/node_modules/@scoped/dep3/package.json" }, - { "pathname": "package/node_modules/@scoped/dep1/package.json" }, - { "pathname": "package/node_modules/@scoped/dep2/package.json" }, + { pathname: "package/package.json" }, + { pathname: "package/node_modules/@scoped/dep1/node_modules/@scoped/dep3/package.json" }, + { pathname: "package/node_modules/@scoped/dep1/package.json" }, + { pathname: "package/node_modules/@scoped/dep2/package.json" }, ]); }); @@ -933,7 +933,7 @@ describe("bundledDependnecies", () => { expect(out).not.toContain("Bundled deps"); const tarball = readTarball(join(packageDir, "pack-bundled-dep-not-dir-4.5.6.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }]); }); }); @@ -954,10 +954,7 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-changelog-1.1.1.tgz")); - expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/lib/index.js" }, - ]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/lib/index.js" }]); }); test(".npmignore cannot exclude CHANGELOG", async () => { @@ -977,10 +974,10 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-changelog-1.1.2.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/CHANGELOG" }, - { "pathname": "package/CHANGELOG.md" }, - { "pathname": "package/CHANGELOG.txt" }, + { pathname: "package/package.json" }, + { pathname: "package/CHANGELOG" }, + { pathname: "package/CHANGELOG.md" }, + { pathname: "package/CHANGELOG.txt" }, ]); }); @@ -1001,9 +998,9 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-license-1.1.1.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/LICENSE" }, - { "pathname": "package/lib/index.js" }, + { pathname: "package/package.json" }, + { pathname: "package/LICENSE" }, + { pathname: "package/lib/index.js" }, ]); }); @@ -1021,7 +1018,7 @@ describe("files", () => { ]); await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-license-1.1.2.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/LICENSE" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/LICENSE" }]); }); test("can include files and directories", async () => { @@ -1047,11 +1044,11 @@ describe("files", () => { const tarball = readTarball(join(packageDir, "pack-files-1-1.1.1.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/root.js" }, - { "pathname": "package/subdir/anotherdir/index.js" }, - { "pathname": "package/subdir/index.js" }, - { "pathname": "package/subdir2/subdir/index.js" }, + { pathname: "package/package.json" }, + { pathname: "package/root.js" }, + { pathname: "package/subdir/anotherdir/index.js" }, + { pathname: "package/subdir/index.js" }, + { pathname: "package/subdir2/subdir/index.js" }, ]); }); @@ -1072,7 +1069,7 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-2-1.2.3.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/index.js" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/index.js" }]); }); test("matches './' as the root", async () => { @@ -1094,9 +1091,9 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-3-1.2.3.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/dist/index.js" }, - { "pathname": "package/src/index.ts" }, + { pathname: "package/package.json" }, + { pathname: "package/dist/index.js" }, + { pathname: "package/src/index.ts" }, ]); }); @@ -1120,10 +1117,10 @@ describe("files", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-files-4-1.2.123.tgz")); expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/index.js" }, - { "pathname": "package/subdir/anotherdir/index.js" }, - { "pathname": "package/subdir/index.js" }, + { pathname: "package/package.json" }, + { pathname: "package/index.js" }, + { pathname: "package/subdir/anotherdir/index.js" }, + { pathname: "package/subdir/index.js" }, ]); }); @@ -1145,10 +1142,7 @@ describe("files", () => { const { out } = await pack(dir, bunEnv); expect(out).toContain("Total files: 2"); const tarball = readTarball(join(dir, "pack-excluded-entries-from-files-1.0.0.tgz")); - expect(tarball.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/src/index.ts" }, - ]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/src/index.ts" }]); }); }); @@ -1169,7 +1163,7 @@ describe(".gitignore/.npmignore", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-ignore-1-0.0.0.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }]); await Promise.all([ rm(join(packageDir, "pack-ignore-1-0.0.0.tgz")), @@ -1178,10 +1172,7 @@ describe(".gitignore/.npmignore", () => { await pack(packageDir, bunEnv); const tarball2 = readTarball(join(packageDir, "pack-ignore-1-0.0.0.tgz")); - expect(tarball2.entries).toMatchObject([ - { "pathname": "package/package.json" }, - { "pathname": "package/index.js" }, - ]); + expect(tarball2.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/index.js" }]); await Promise.all([ rm(join(packageDir, "pack-ignore-1-0.0.0.tgz")), @@ -1190,7 +1181,7 @@ describe(".gitignore/.npmignore", () => { await pack(packageDir, bunEnv); const tarball3 = readTarball(join(packageDir, "pack-ignore-1-0.0.0.tgz")); - expect(tarball3.entries).toMatchObject([{ "pathname": "package/package.json" }]); + expect(tarball3.entries).toMatchObject([{ pathname: "package/package.json" }]); }); } @@ -1211,7 +1202,7 @@ describe(".gitignore/.npmignore", () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-ignore-2-1.2.1.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }]); }); }); @@ -1296,7 +1287,7 @@ test("unicode", async () => { await pack(packageDir, bunEnv); const tarball = readTarball(join(packageDir, "pack-unicode-1.1.1.tgz")); - expect(tarball.entries).toMatchObject([{ "pathname": "package/package.json" }, { "pathname": "package/รครถรผลกฤล™รญ.js" }]); + expect(tarball.entries).toMatchObject([{ pathname: "package/package.json" }, { pathname: "package/รครถรผลกฤล™รญ.js" }]); }); test("$npm_command is accurate", async () => { diff --git a/test/cli/install/bun-patch.test.ts b/test/cli/install/bun-patch.test.ts index c81a74404e..463b1646d0 100644 --- a/test/cli/install/bun-patch.test.ts +++ b/test/cli/install/bun-patch.test.ts @@ -26,10 +26,10 @@ describe("bun patch ", async () => { test(arg, async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -40,7 +40,7 @@ describe("bun patch ", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, @@ -49,15 +49,15 @@ describe("bun patch ", async () => { }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -101,10 +101,10 @@ describe("bun patch ", async () => { test(arg, async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -116,7 +116,7 @@ describe("bun patch ", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, @@ -125,15 +125,15 @@ describe("bun patch ", async () => { }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -179,10 +179,10 @@ describe("bun patch ", async () => { test(arg, async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -194,7 +194,7 @@ describe("bun patch ", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, @@ -203,12 +203,12 @@ describe("bun patch ", async () => { }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -265,10 +265,10 @@ describe("bun patch ", async () => { test(arg, async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "my-workspace", + name: "my-workspace", private: "true", version: "0.0.1", - "devDependencies": { + devDependencies: { "@repo/ui": "*", "@repo/eslint-config": "*", "@repo/typescript-config": "*", @@ -280,7 +280,7 @@ describe("bun patch ", async () => { "eslint-config": { "package.json": JSON.stringify({ name: "@repo/eslint-config", - "version": "0.0.0", + version: "0.0.0", dependencies: { "@types/ws": "8.5.4", }, @@ -289,12 +289,12 @@ describe("bun patch ", async () => { }, "typescript-config": { "package.json": JSON.stringify({ - "name": "@repo/typescript-config", - "version": "0.0.0", + name: "@repo/typescript-config", + version: "0.0.0", private: "true", }), }, - "ui": { + ui: { "package.json": JSON.stringify({ name: "@repo/ui", version: "0.0.0", @@ -344,10 +344,10 @@ describe("bun patch ", async () => { async () => { const tempdir = tempDirWithFiles("popular", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { [pkgName]: version, }, }), @@ -414,10 +414,10 @@ describe("bun patch ", async () => { test("should patch a package when it is already patched", async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", "is-odd": "3.0.1", }, @@ -502,10 +502,10 @@ module.exports = function isOdd(i) { test("bad patch arg", async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -521,10 +521,10 @@ module.exports = function isOdd(i) { test("bad patch commit arg", async () => { const tempdir = tempDirWithFiles("lol", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -565,10 +565,10 @@ module.exports = function isOdd(i) { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": dependencies, + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: dependencies, }), "index.ts": mainScript, }); @@ -609,10 +609,10 @@ Once you're done with your changes, run: async () => { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { lodash: "4.17.21" }, + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { lodash: "4.17.21" }, }), "index.ts": /* ts */ `import isEven from 'is-even'; console.log(isEven())`, }); @@ -713,10 +713,10 @@ Once you're done with your changes, run: const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -739,10 +739,10 @@ module.exports = function isEven() { const tempdir = tempDirWithFiles("unpatched", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), @@ -768,10 +768,10 @@ module.exports = function isEven() { const filedir = tempDirWithFiles("patch1", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", "is-odd": "3.0.1", }, @@ -796,10 +796,10 @@ module.exports = function isOdd() { const tempdir = tempDirWithFiles("unpatched", { "package.json": JSON.stringify({ - "name": "bun-patch-test", - "module": "index.ts", - "type": "module", - "dependencies": { + name: "bun-patch-test", + module: "index.ts", + type: "module", + dependencies: { "is-even": "1.0.0", }, }), diff --git a/test/cli/install/bun-pm-pkg.test.ts b/test/cli/install/bun-pm-pkg.test.ts index 7ffaafa2b9..e8439edb31 100644 --- a/test/cli/install/bun-pm-pkg.test.ts +++ b/test/cli/install/bun-pm-pkg.test.ts @@ -39,11 +39,11 @@ function createTestPackageJson(overrides = {}) { author: "Test Author", license: "MIT", dependencies: { - "lodash": "^4.17.21", - "react": "^18.0.0", + lodash: "^4.17.21", + react: "^18.0.0", }, devDependencies: { - "typescript": "^5.0.0", + typescript: "^5.0.0", "@types/node": "^20.0.0", }, engines: { @@ -839,13 +839,13 @@ describe("bun pm pkg", () => { name: "my-project", version: "1.0.0", scripts: { - "test": "jest", + test: "jest", "test:watch": "jest --watch", - "build": "webpack", + build: "webpack", "build:prod": "webpack --mode=production", }, dependencies: { - "react": "^18.0.0", + react: "^18.0.0", "@types/node": "^20.0.0", }, workspaces: ["packages/*", "apps/*"], @@ -893,11 +893,11 @@ describe("bun pm pkg", () => { description: "Test package", main: "index.js", bin: { - "mycli": "./bin/nonexistent.js", - "othercli": "./bin/also-missing.js", + mycli: "./bin/nonexistent.js", + othercli: "./bin/also-missing.js", }, dependencies: { - "react": "^18.0.0", + react: "^18.0.0", }, }, null, @@ -961,7 +961,7 @@ describe("bun pm pkg", () => { name: "BIN-PACKAGE", version: "1.0.0", bin: { - "actualcli": "./bin/real.js", + actualcli: "./bin/real.js", }, }, null, @@ -1037,8 +1037,8 @@ describe("bun pm pkg", () => { name: "MULTIPLE-ISSUES-PACKAGE", version: "1.0.0", bin: { - "missing1": "./nonexistent1.js", - "missing2": "./nonexistent2.js", + missing1: "./nonexistent1.js", + missing2: "./nonexistent2.js", }, }, null, diff --git a/test/cli/install/bun-pm-why.test.ts b/test/cli/install/bun-pm-why.test.ts index b0e603851e..7300ad8226 100644 --- a/test/cli/install/bun-pm-why.test.ts +++ b/test/cli/install/bun-pm-why.test.ts @@ -30,8 +30,8 @@ describe.each(["why", "pm why"])("bun %s", cmd => { name: "test-package", version: "1.0.0", dependencies: { - "lodash": "^4.17.21", - "react": "^18.0.0", + lodash: "^4.17.21", + react: "^18.0.0", }, devDependencies: { "@types/react": "^18.0.0", @@ -58,13 +58,13 @@ describe.each(["why", "pm why"])("bun %s", cmd => { name: "complex-package", version: "1.0.0", dependencies: { - "express": "^4.18.2", - "react": "^18.0.0", + express: "^4.18.2", + react: "^18.0.0", "react-dom": "^18.0.0", }, devDependencies: { "@types/express": "^4.17.17", - "typescript": "^5.0.0", + typescript: "^5.0.0", }, }, null, @@ -310,16 +310,16 @@ describe.each(["why", "pm why"])("bun %s", cmd => { name: "foo", version: "0.0.1", dependencies: { - "express": "^4.18.2", + express: "^4.18.2", }, devDependencies: { - "typescript": "^5.0.0", + typescript: "^5.0.0", }, peerDependencies: { - "react": "^18.0.0", + react: "^18.0.0", }, optionalDependencies: { - "chalk": "^5.0.0", + chalk: "^5.0.0", }, }), ); @@ -374,7 +374,7 @@ describe.each(["why", "pm why"])("bun %s", cmd => { name: "multi-version-test", version: "1.0.0", dependencies: { - "react": "^18.0.0", + react: "^18.0.0", "old-package": "npm:react@^16.0.0", }, }), @@ -448,8 +448,8 @@ describe.each(["why", "pm why"])("bun %s", cmd => { name: "version-test", version: "1.0.0", dependencies: { - "react": "^18.0.0", - "lodash": "^4.17.21", + react: "^18.0.0", + lodash: "^4.17.21", }, }), ); diff --git a/test/cli/install/bun-publish.test.ts b/test/cli/install/bun-publish.test.ts index 42f8b83afe..a20e44dcbb 100644 --- a/test/cli/install/bun-publish.test.ts +++ b/test/cli/install/bun-publish.test.ts @@ -218,7 +218,7 @@ describe("otp", async () => { const fakeCIEnvs = [ { ci: "expo-application-services", envs: { EAS_BUILD: "hi" } }, { ci: "codemagic", envs: { CM_BUILD_ID: "hi" } }, - { ci: "vercel", envs: { "NOW_BUILDER": "hi" } }, + { ci: "vercel", envs: { NOW_BUILDER: "hi" } }, ]; for (const envInfo of fakeCIEnvs) { test(`CI user agent name: ${envInfo.ci}`, async () => { @@ -508,7 +508,7 @@ test("can publish workspace package", async () => { await publish(env, join(packageDir, "packages", "publish-pkg-3")); - await write(packageJson, JSON.stringify({ name: "root", "dependencies": { "publish-pkg-3": "3.3.3" } })); + await write(packageJson, JSON.stringify({ name: "root", dependencies: { "publish-pkg-3": "3.3.3" } })); await runBunInstall(env, packageDir); @@ -580,12 +580,12 @@ postpack: \${fs.existsSync("postpack.txt")}\`)`; version: "4.4.4", scripts: { // should happen in this order - "prepublishOnly": `${bunExe()} script.js prepublishOnly`, - "prepack": `${bunExe()} script.js prepack`, - "prepare": `${bunExe()} script.js prepare`, - "postpack": `${bunExe()} script.js postpack`, - "publish": `${bunExe()} script.js publish`, - "postpublish": `${bunExe()} script.js postpublish`, + prepublishOnly: `${bunExe()} script.js prepublishOnly`, + prepack: `${bunExe()} script.js prepack`, + prepare: `${bunExe()} script.js prepare`, + postpack: `${bunExe()} script.js postpack`, + publish: `${bunExe()} script.js publish`, + postpublish: `${bunExe()} script.js postpublish`, }, dependencies: { "publish-pkg-4": "4.4.4", diff --git a/test/cli/install/bun-run.test.ts b/test/cli/install/bun-run.test.ts index d9cfbc96fa..d1f7b3cf01 100644 --- a/test/cli/install/bun-run.test.ts +++ b/test/cli/install/bun-run.test.ts @@ -76,7 +76,7 @@ for (let withRun of [false, true]) { name: "test", version: "0.0.0", scripts: { - "boop": "echo hi", + boop: "echo hi", }, }), ); @@ -585,7 +585,7 @@ it("should pass arguments correctly in scripts", async () => { const dir = tempDirWithFiles("test", { "package.json": JSON.stringify({ workspaces: ["a", "b"], - scripts: { "root_script": "bun index.ts" }, + scripts: { root_script: "bun index.ts" }, }), "index.ts": `for(const arg of Bun.argv) console.log(arg);`, "a/package.json": JSON.stringify({ name: "a", scripts: { echo2: "echo" } }), @@ -647,7 +647,7 @@ describe("should handle run case", () => { const dir = tempDirWithFiles("test", { "package.json": JSON.stringify({ scripts: { - "root_script": ` ${ccase[0]} target_script% `, + root_script: ` ${ccase[0]} target_script% `, "target_script%": " echo target_script ", }, }), @@ -685,22 +685,22 @@ describe("'bun run' priority", async () => { // - 3: execute a node_modules/.bin/ command // - 4: ('run' only): execute a system command, like 'ls' const dir = tempDirWithFiles("test", { - "test": { "index.js": "console.log('test/index.js');" }, - "build": { "script.js": "console.log('build/script.js');" }, - "consume": { "index.js": "console.log('consume/index.js');" }, + test: { "index.js": "console.log('test/index.js');" }, + build: { "script.js": "console.log('build/script.js');" }, + consume: { "index.js": "console.log('consume/index.js');" }, "index.js": "console.log('index.js')", "main.js": "console.log('main.js')", "typescript.ts": "console.log('typescript.ts')", "sample.js": "console.log('sample.js')", - "noext": "console.log('noext')", - "folderandfile": { "index.js": "console.log('folderandfile/index.js')" }, + noext: "console.log('noext')", + folderandfile: { "index.js": "console.log('folderandfile/index.js')" }, "folderandfile.js": "console.log('folderandfile.js')", "shellscript.sh": "echo shellscript.sh", ".secretscript.js": "console.log('.secretscript.js')", "package.json": JSON.stringify({ scripts: { - "build": "echo scripts/build", - "test": "echo scripts/test", + build: "echo scripts/build", + test: "echo scripts/test", "sample.js": "echo scripts/sample.js", "ยง'.js": 'echo "scripts/ยง\'.js"', "test.todo": "echo scripts/test.todo", @@ -711,10 +711,10 @@ describe("'bun run' priority", async () => { }), "nx.json": JSON.stringify({}), "ยง'.js": 'console.log("ยง\'.js")', - "node_modules": { + node_modules: { ".bin": { - "confabulate": `#!${bunExe()}\nconsole.log("node_modules/.bin/confabulate")`, - "nx": `#!${bunExe()}\nconsole.log("node_modules/.bin/nx")`, + confabulate: `#!${bunExe()}\nconsole.log("node_modules/.bin/confabulate")`, + nx: `#!${bunExe()}\nconsole.log("node_modules/.bin/nx")`, }, }, "no_run_json.json": JSON.stringify({}), @@ -901,12 +901,12 @@ describe.todo("run from stdin", async () => { describe("should run scripts from the project root (#16169)", async () => { const dir = tempDirWithFiles("test", { - "run_here": { + run_here: { "myscript.ts": "console.log('successful run')", "package.json": JSON.stringify({ - scripts: { "sample": "pwd", "runscript": "bun myscript.ts" }, + scripts: { sample: "pwd", runscript: "bun myscript.ts" }, }), - "dont_run_in_here": { + dont_run_in_here: { "runme.ts": "console.log('do run this script')", }, }, @@ -1000,12 +1000,12 @@ describe("run main within monorepo", async () => { workspaces: ["packages/*"], }), "monorepo_root.ts": "console.log('monorepo_root')", - "packages": { - "package_a": { + packages: { + package_a: { "package.json": JSON.stringify({ name: "package_a", main: "package_a.ts" }), "package_a.ts": "console.log('package_a')", }, - "package_b": { + package_b: { "package.json": JSON.stringify({ name: "package_b" }), }, }, diff --git a/test/cli/install/bun-upgrade.test.ts b/test/cli/install/bun-upgrade.test.ts index 189f8154a2..1543059b45 100644 --- a/test/cli/install/bun-upgrade.test.ts +++ b/test/cli/install/bun-upgrade.test.ts @@ -104,49 +104,49 @@ it("zero arguments, should succeed", async () => { async fetch() { return new Response( JSON.stringify({ - "tag_name": tagName, - "assets": [ + tag_name: tagName, + assets: [ { - "url": "foo", - "content_type": "application/zip", - "name": "bun-windows-x64.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-x64.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-windows-x64.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-x64.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-windows-x64-baseline.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-x64-baseline.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-windows-x64-baseline.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-windows-x64-baseline.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-linux-x64.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-x64.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-linux-x64.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-x64.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-linux-x64-baseline.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-x64-baseline.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-linux-x64-baseline.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-linux-x64-baseline.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-darwin-x64.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-x64.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-darwin-x64.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-x64.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-darwin-x64-baseline.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-x64-baseline.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-darwin-x64-baseline.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-x64-baseline.zip`, }, { - "url": "foo", - "content_type": "application/zip", - "name": "bun-darwin-aarch64.zip", - "browser_download_url": `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-aarch64.zip`, + url: "foo", + content_type: "application/zip", + name: "bun-darwin-aarch64.zip", + browser_download_url: `https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${tagName}/bun-darwin-aarch64.zip`, }, ], }), diff --git a/test/cli/install/bun-workspaces.test.ts b/test/cli/install/bun-workspaces.test.ts index 219c2b50ac..a7ebd8c495 100644 --- a/test/cli/install/bun-workspaces.test.ts +++ b/test/cli/install/bun-workspaces.test.ts @@ -347,7 +347,7 @@ describe("workspace aliases", async () => { name: "foo", workspaces: ["packages/*"], dependencies: { - "a0": "workspace:@org/a@latest", + a0: "workspace:@org/a@latest", }, }), ), @@ -356,8 +356,8 @@ describe("workspace aliases", async () => { JSON.stringify({ name: "@org/a", dependencies: { - "a1": "workspace:@org/b@ ", - "a2": "workspace:c@*", + a1: "workspace:@org/b@ ", + a2: "workspace:c@*", }, }), ), @@ -366,8 +366,8 @@ describe("workspace aliases", async () => { JSON.stringify({ name: "@org/b", dependencies: { - "a3": "workspace:c@ ", - "a4": "workspace:@org/a@latest", + a3: "workspace:c@ ", + a4: "workspace:@org/a@latest", }, }), ), @@ -376,7 +376,7 @@ describe("workspace aliases", async () => { JSON.stringify({ name: "c", dependencies: { - "a5": "workspace:@org/a@*", + a5: "workspace:@org/a@*", }, }), ), @@ -419,7 +419,7 @@ describe("workspace aliases", async () => { JSON.stringify({ name: "@org/a", dependencies: { - "a1": version, + a1: version, }, }), ), @@ -457,7 +457,7 @@ describe("workspace aliases", async () => { JSON.stringify({ name: "@org/a", dependencies: { - "a1": version, + a1: version, }, }), ), @@ -553,7 +553,7 @@ describe("relative tarballs", async () => { JSON.stringify({ name: "pkg1", dependencies: { - "qux": "../../qux-0.0.2.tgz", + qux: "../../qux-0.0.2.tgz", }, }), ), @@ -800,7 +800,7 @@ test("adding packages in workspaces", async () => { name: "foo", workspaces: ["packages/*"], dependencies: { - "bar": "workspace:*", + bar: "workspace:*", }, }), ); @@ -812,7 +812,7 @@ test("adding packages in workspaces", async () => { await write(join(packageDir, "packages", "bar", "package.json"), JSON.stringify({ name: "bar" })); await write( join(packageDir, "packages", "boba", "package.json"), - JSON.stringify({ name: "boba", version: "1.0.0", dependencies: { "pkg5": "*" } }), + JSON.stringify({ name: "boba", version: "1.0.0", dependencies: { pkg5: "*" } }), ); await write( join(packageDir, "packages", "pkg5", "package.json"), @@ -820,7 +820,7 @@ test("adding packages in workspaces", async () => { name: "pkg5", version: "1.2.3", dependencies: { - "bar": "workspace:*", + bar: "workspace:*", }, }), ); @@ -901,7 +901,7 @@ test("adding packages in workspaces", async () => { name: "boba", version: "1.0.0", dependencies: { - "pkg5": "*", + pkg5: "*", "two-range-deps": "^1.0.0", }, }); @@ -938,9 +938,9 @@ test("adding packages in workspaces", async () => { name: "boba", version: "1.0.0", dependencies: { - "pkg5": "*", + pkg5: "*", "two-range-deps": "^1.0.0", - "bar": "0.0.7", + bar: "0.0.7", }, }); expect(await readdirSorted(join(packageDir, "node_modules"))).toEqual([ @@ -1495,7 +1495,7 @@ describe("install --filter", () => { JSON.stringify({ name: "pkg2", dependencies: { - "pkg1": "1.0.0", + pkg1: "1.0.0", }, }), ), diff --git a/test/cli/install/isolated-install.test.ts b/test/cli/install/isolated-install.test.ts index 4763b537f0..2bb5e33612 100644 --- a/test/cli/install/isolated-install.test.ts +++ b/test/cli/install/isolated-install.test.ts @@ -622,7 +622,7 @@ test("many transitive dependencies", async () => { name: "alias-loop-1", version: "1.0.0", dependencies: { - "alias1": "npm:alias-loop-2@*", + alias1: "npm:alias-loop-2@*", }, }); expect( @@ -633,7 +633,7 @@ test("many transitive dependencies", async () => { name: "alias-loop-2", version: "1.0.0", dependencies: { - "alias2": "npm:alias-loop-1@*", + alias2: "npm:alias-loop-1@*", }, }); expect(await readdirSorted(join(packageDir, "node_modules", ".bun", "alias-loop-1@1.0.0", "node_modules"))).toEqual([ @@ -693,7 +693,7 @@ test("dependency names are preserved", async () => { name: "alias-loop-1", version: "1.0.0", dependencies: { - "alias1": "npm:alias-loop-2@*", + alias1: "npm:alias-loop-2@*", }, }); expect( @@ -704,7 +704,7 @@ test("dependency names are preserved", async () => { name: "alias-loop-2", version: "1.0.0", dependencies: { - "alias2": "npm:alias-loop-1@*", + alias2: "npm:alias-loop-1@*", }, }); }); diff --git a/test/cli/install/migration/migrate.test.ts b/test/cli/install/migration/migrate.test.ts index b1527621f4..2545732700 100644 --- a/test/cli/install/migration/migrate.test.ts +++ b/test/cli/install/migration/migrate.test.ts @@ -15,7 +15,7 @@ function testMigration(lockfile: string) { JSON.stringify({ name: "test3", dependencies: { - "svelte": "*", + svelte: "*", }, }), ); @@ -125,7 +125,7 @@ test("npm lockfile with relative workspaces", async () => { expect(err).not.toContain("InvalidNPMLockfile"); for (let i = 0; i < 4; i++) { expect(await Bun.file(join(testDir, "node_modules", "pkg" + i, "package.json")).json()).toEqual({ - "name": "pkg" + i, + name: "pkg" + i, }); } diff --git a/test/cli/install/migration/yarn-lock-migration.test.ts b/test/cli/install/migration/yarn-lock-migration.test.ts index 738f8e7898..5e719b869d 100644 --- a/test/cli/install/migration/yarn-lock-migration.test.ts +++ b/test/cli/install/migration/yarn-lock-migration.test.ts @@ -58,18 +58,18 @@ is-number@^7.0.0: name: "complex-test", version: "1.0.0", dependencies: { - "express": "^4.18.2", - "lodash": "^4.17.21", + express: "^4.18.2", + lodash: "^4.17.21", }, devDependencies: { - "jest": "^29.0.0", - "typescript": "^5.0.0", + jest: "^29.0.0", + typescript: "^5.0.0", }, optionalDependencies: { - "fsevents": "^2.3.2", + fsevents: "^2.3.2", }, peerDependencies: { - "react": "^18.0.0", + react: "^18.0.0", }, }, null, @@ -643,10 +643,10 @@ undici-types@~5.26.4: name: "resolutions-test", version: "1.0.0", dependencies: { - "webpack": "^5.89.0", + webpack: "^5.89.0", }, resolutions: { - "acorn": "8.11.3", + acorn: "8.11.3", "webpack/acorn": "8.11.2", }, }, @@ -734,7 +734,7 @@ webpack@^5.89.0: private: true, workspaces: ["packages/*"], dependencies: { - "lodash": "^4.17.21", + lodash: "^4.17.21", }, }, null, @@ -956,21 +956,21 @@ babel-loader/chalk@^2.4.2: name: "complex-app", version: "1.0.0", dependencies: { - "react": "^18.2.0", + react: "^18.2.0", "react-dom": "^18.2.0", "@babel/core": "^7.20.0", - "webpack": "^5.75.0", + webpack: "^5.75.0", }, devDependencies: { "@types/react": "^18.0.0", - "typescript": "^4.9.0", - "eslint": "^8.0.0", + typescript: "^4.9.0", + eslint: "^8.0.0", }, peerDependencies: { - "react": ">=16.8.0", + react: ">=16.8.0", }, optionalDependencies: { - "fsevents": "^2.3.2", + fsevents: "^2.3.2", }, }, null, diff --git a/test/cli/install/npmrc.test.ts b/test/cli/install/npmrc.test.ts index 8751a559fb..88b65ae9dc 100644 --- a/test/cli/install/npmrc.test.ts +++ b/test/cli/install/npmrc.test.ts @@ -307,8 +307,8 @@ registry = http://localhost:${registry.port}/ "no-deps": "1.0.0", "@needs-auth/test-pkg": "1.0.0", }, - "publishConfig": { - "registry": `http://localhost:${registry.port}`, + publishConfig: { + registry: `http://localhost:${registry.port}`, }, })} > package.json`.cwd(packageDir); @@ -367,8 +367,8 @@ ${Object.keys(opts) dependencies: { "@needs-auth/test-pkg": "1.0.0", }, - "publishConfig": { - "registry": `http://localhost:${registry.port}`, + publishConfig: { + registry: `http://localhost:${registry.port}`, }, })} > package.json`.cwd(packageDir); @@ -382,7 +382,7 @@ ${Object.keys(opts) } registryConfigOptionTest("_authToken", async () => ({ - "_authToken": await registry.generateUser("bilbo_baggins", "verysecure"), + _authToken: await registry.generateUser("bilbo_baggins", "verysecure"), })); registryConfigOptionTest( "_authToken with env variable value", diff --git a/test/cli/install/overrides.test.ts b/test/cli/install/overrides.test.ts index 2c92bb3384..ed10bb89b1 100644 --- a/test/cli/install/overrides.test.ts +++ b/test/cli/install/overrides.test.ts @@ -193,7 +193,7 @@ test("overrides do not apply to workspaces", async () => { await Promise.all([ write( join(tmp, "package.json"), - JSON.stringify({ name: "monorepo-root", workspaces: ["packages/*"], overrides: { "pkg1": "file:pkg2" } }), + JSON.stringify({ name: "monorepo-root", workspaces: ["packages/*"], overrides: { pkg1: "file:pkg2" } }), ), write( join(tmp, "packages", "pkg1", "package.json"), diff --git a/test/cli/install/test-dev-peer-dependency-priority.test.ts b/test/cli/install/test-dev-peer-dependency-priority.test.ts index 6c8708b9fe..104c302bcc 100644 --- a/test/cli/install/test-dev-peer-dependency-priority.test.ts +++ b/test/cli/install/test-dev-peer-dependency-priority.test.ts @@ -17,10 +17,10 @@ test("workspace devDependencies should take priority over peerDependencies for r version: "1.0.0", dependencies: {}, devDependencies: { - "jquery": "workspace:*", // Use workspace protocol for dev + jquery: "workspace:*", // Use workspace protocol for dev }, peerDependencies: { - "jquery": "3.7.0", // Range wants 3.7.0 + jquery: "3.7.0", // Range wants 3.7.0 }, }), "packages/lib/test.js": `const dep = require("jquery"); console.log(dep.version);`, @@ -125,10 +125,10 @@ test("devDependencies and peerDependencies with different versions should coexis version: "1.0.0", dependencies: {}, devDependencies: { - "utils": "1.0.0", + utils: "1.0.0", }, peerDependencies: { - "utils": "^1.0.0", + utils: "^1.0.0", }, }), "packages/lib/index.js": `console.log("lib");`, @@ -178,10 +178,10 @@ test("dependency behavior comparison prioritizes devDependencies", async () => { version: "1.0.0", dependencies: {}, devDependencies: { - "typescript": "^5.0.0", + typescript: "^5.0.0", }, peerDependencies: { - "typescript": "^4.0.0 || ^5.0.0", + typescript: "^4.0.0 || ^5.0.0", }, }), "index.js": `console.log("app");`, @@ -233,10 +233,10 @@ test("Next.js monorepo scenario should not make unnecessary network requests", a version: "1.0.0", dependencies: {}, devDependencies: { - "next": "15.0.0-canary.119", // Specific canary version for dev + next: "15.0.0-canary.119", // Specific canary version for dev }, peerDependencies: { - "next": "^14.0.0 || ^15.0.0", // Range that would accept 14.x or 15.x stable + next: "^14.0.0 || ^15.0.0", // Range that would accept 14.x or 15.x stable }, }), "packages/web/test.js": `const next = require("next/package.json"); console.log(next.version);`, diff --git a/test/cli/run/env.test.ts b/test/cli/run/env.test.ts index 295c0e0056..f3e7302181 100644 --- a/test/cli/run/env.test.ts +++ b/test/cli/run/env.test.ts @@ -258,10 +258,10 @@ test(".env process variables no comments", () => { describe("package scripts load from .env.production and .env.development", () => { test("NODE_ENV=production", () => { const pkgjson = { - "name": "foo", - "version": "2.0", - "scripts": { - "test": `'${bunExe()}' run index.ts`, + name: "foo", + version: "2.0", + scripts: { + test: `'${bunExe()}' run index.ts`, }, }; const dir = tempDirWithFiles("dotenv-package-script-prod", { @@ -271,15 +271,15 @@ describe("package scripts load from .env.production and .env.development", () => ".env.development": "TEST=dev", }); - const { stdout } = bunRunAsScript(dir, "test", { "NODE_ENV": "production" }); + const { stdout } = bunRunAsScript(dir, "test", { NODE_ENV: "production" }); expect(stdout).toBe("prod"); }); test("NODE_ENV=development", () => { const pkgjson = { - "name": "foo", - "version": "2.0", - "scripts": { - "test": `'${bunExe()}' run index.ts`, + name: "foo", + version: "2.0", + scripts: { + test: `'${bunExe()}' run index.ts`, }, }; const dir = tempDirWithFiles("dotenv-package-script-prod", { @@ -289,7 +289,7 @@ describe("package scripts load from .env.production and .env.development", () => ".env.development": "TEST=dev", }); - const { stdout } = bunRunAsScript(dir, "test", { "NODE_ENV": "development" }); + const { stdout } = bunRunAsScript(dir, "test", { NODE_ENV: "development" }); expect(stdout).toBe("dev"); }); }); diff --git a/test/cli/run/if-present.test.ts b/test/cli/run/if-present.test.ts index 96e712a466..1ea08caa33 100644 --- a/test/cli/run/if-present.test.ts +++ b/test/cli/run/if-present.test.ts @@ -8,9 +8,9 @@ beforeAll(() => { cwd = tempDirWithFiles("--if-present", { "present.js": "console.log('Here!');", "package.json": JSON.stringify({ - "name": "present", - "scripts": { - "present": "echo 'Here!'", + name: "present", + scripts: { + present: "echo 'Here!'", }, }), }); diff --git a/test/cli/run/jsx-namespaced-attributes.test.ts b/test/cli/run/jsx-namespaced-attributes.test.ts index 1419874901..eef8d808de 100644 --- a/test/cli/run/jsx-namespaced-attributes.test.ts +++ b/test/cli/run/jsx-namespaced-attributes.test.ts @@ -2,8 +2,8 @@ import { expect, it } from "bun:test"; import { nsExample1, nsExample2, nsExample3, nsExample4 } from "../../snippets/jsx-attributes.tsx"; it("parses namespaced attributes correctly", () => { - expect(nsExample1.props).toEqual({ "ns:bar": "baz", "tag": true }); - expect(nsExample2.props).toEqual({ "ns:bar42": "baz", "tag": false }); + expect(nsExample1.props).toEqual({ "ns:bar": "baz", tag: true }); + expect(nsExample2.props).toEqual({ "ns:bar42": "baz", tag: false }); expect(nsExample3.props).toEqual({ "ns:bar42bar": "baz" }); expect(nsExample4.props).toEqual({ "ns42:bar": "baz" }); }); diff --git a/test/cli/run/run-process-env.test.ts b/test/cli/run/run-process-env.test.ts index 3606ee451c..160c87709f 100644 --- a/test/cli/run/run-process-env.test.ts +++ b/test/cli/run/run-process-env.test.ts @@ -6,7 +6,7 @@ describe("process.env", () => { const scriptName = "start:dev"; const dir = tempDirWithFiles("processenv", { - "package.json": JSON.stringify({ "scripts": { [`${scriptName}`]: `'${bunExe()}' run index.ts` } }), + "package.json": JSON.stringify({ scripts: { [`${scriptName}`]: `'${bunExe()}' run index.ts` } }), "index.ts": "console.log(process.env.npm_lifecycle_event);", }); const { stdout } = bunRunAsScript(dir, scriptName); @@ -17,7 +17,7 @@ describe("process.env", () => { test("npm_lifecycle_event should have the value of the last call", () => { const dir = tempDirWithFiles("processenv_ls_call", { "package.json": JSON.stringify({ scripts: { first: `'${bunExe()}' run --cwd lsc second` } }), - "lsc": { + lsc: { "package.json": JSON.stringify({ scripts: { second: `'${bunExe()}' run index.ts` } }), "index.ts": "console.log(process.env.npm_lifecycle_event);", }, diff --git a/test/cli/update_interactive_formatting.test.ts b/test/cli/update_interactive_formatting.test.ts index 7b28c7318f..f96a65683c 100644 --- a/test/cli/update_interactive_formatting.test.ts +++ b/test/cli/update_interactive_formatting.test.ts @@ -9,10 +9,10 @@ describe("bun update --interactive formatting", () => { name: "test-project", version: "1.0.0", dependencies: { - "a": "1.0.0", + a: "1.0.0", "really-long-package-name-that-causes-formatting-issues": "1.0.0", "@org/extremely-long-scoped-package-name-that-will-test-formatting": "1.0.0", - "short": "1.0.0", + short: "1.0.0", "another-package-with-a-very-long-name-to-test-column-alignment": "1.0.0", }, devDependencies: { @@ -29,51 +29,51 @@ describe("bun update --interactive formatting", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { - "a": { - "integrity": "sha512-fake", - "version": "1.0.0", + lockfileVersion: 3, + packages: { + a: { + integrity: "sha512-fake", + version: "1.0.0", }, "really-long-package-name-that-causes-formatting-issues": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "@org/extremely-long-scoped-package-name-that-will-test-formatting": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, - "short": { - "integrity": "sha512-fake", - "version": "1.0.0", + short: { + integrity: "sha512-fake", + version: "1.0.0", }, "another-package-with-a-very-long-name-to-test-column-alignment": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "dev-package": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "super-long-dev-package-name-that-should-not-break-formatting": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "peer-package": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "extremely-long-peer-dependency-name-for-testing-column-alignment": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "optional-package": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "very-long-optional-dependency-name-that-tests-formatting": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, }, }), @@ -126,19 +126,19 @@ describe("bun update --interactive formatting", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { + lockfileVersion: 3, + packages: { "package-with-long-version": { - "integrity": "sha512-fake", - "version": "1.0.0-alpha.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20", + integrity: "sha512-fake", + version: "1.0.0-alpha.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20", }, "package-with-short-version": { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, "package-with-prerelease": { - "integrity": "sha512-fake", - "version": "1.0.0-beta.1+build.1234567890.abcdef", + integrity: "sha512-fake", + version: "1.0.0-beta.1+build.1234567890.abcdef", }, }, }), @@ -176,11 +176,11 @@ describe("bun update --interactive formatting", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { + lockfileVersion: 3, + packages: { [extremelyLongPackageName]: { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, }, }), @@ -213,33 +213,33 @@ describe("bun update --interactive formatting", () => { name: "test-project", version: "1.0.0", dependencies: { - "a": "1.0.0", + a: "1.0.0", "really-long-dependency-name": "1.0.0", }, devDependencies: { - "b": "1.0.0", + b: "1.0.0", "super-long-dev-dependency-name": "1.0.0", }, peerDependencies: { - "c": "1.0.0", + c: "1.0.0", "extremely-long-peer-dependency-name": "1.0.0", }, optionalDependencies: { - "d": "1.0.0", + d: "1.0.0", "very-long-optional-dependency-name": "1.0.0", }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { - "a": { "integrity": "sha512-fake", "version": "1.0.0" }, - "really-long-dependency-name": { "integrity": "sha512-fake", "version": "1.0.0" }, - "b": { "integrity": "sha512-fake", "version": "1.0.0" }, - "super-long-dev-dependency-name": { "integrity": "sha512-fake", "version": "1.0.0" }, - "c": { "integrity": "sha512-fake", "version": "1.0.0" }, - "extremely-long-peer-dependency-name": { "integrity": "sha512-fake", "version": "1.0.0" }, - "d": { "integrity": "sha512-fake", "version": "1.0.0" }, - "very-long-optional-dependency-name": { "integrity": "sha512-fake", "version": "1.0.0" }, + lockfileVersion: 3, + packages: { + a: { integrity: "sha512-fake", version: "1.0.0" }, + "really-long-dependency-name": { integrity: "sha512-fake", version: "1.0.0" }, + b: { integrity: "sha512-fake", version: "1.0.0" }, + "super-long-dev-dependency-name": { integrity: "sha512-fake", version: "1.0.0" }, + c: { integrity: "sha512-fake", version: "1.0.0" }, + "extremely-long-peer-dependency-name": { integrity: "sha512-fake", version: "1.0.0" }, + d: { integrity: "sha512-fake", version: "1.0.0" }, + "very-long-optional-dependency-name": { integrity: "sha512-fake", version: "1.0.0" }, }, }), }); diff --git a/test/cli/update_interactive_snapshots.test.ts b/test/cli/update_interactive_snapshots.test.ts index ccdc8dc69c..fde74fccb2 100644 --- a/test/cli/update_interactive_snapshots.test.ts +++ b/test/cli/update_interactive_snapshots.test.ts @@ -8,8 +8,8 @@ describe("bun update --interactive snapshots", () => { name: "test-project", version: "1.0.0", dependencies: { - "short": "1.0.0", - "react": "17.0.2", + short: "1.0.0", + react: "17.0.2", "really-long-package-name-for-testing": "1.0.0", "@scoped/package": "1.0.0", "@organization/extremely-long-scoped-package-name": "1.0.0", @@ -17,7 +17,7 @@ describe("bun update --interactive snapshots", () => { devDependencies: { "dev-pkg": "1.0.0", "super-long-dev-package-name-for-testing": "1.0.0", - "typescript": "4.8.0", + typescript: "4.8.0", }, peerDependencies: { "peer-pkg": "1.0.0", diff --git a/test/integration/esbuild/esbuild.test.ts b/test/integration/esbuild/esbuild.test.ts index dfad697fc4..73892bfdad 100644 --- a/test/integration/esbuild/esbuild.test.ts +++ b/test/integration/esbuild/esbuild.test.ts @@ -118,9 +118,9 @@ describe("esbuild integration test", () => { name: "bun-esbuild-estrella-test", version: "1.0.0", dependencies: { - "estrella": "1.4.1", + estrella: "1.4.1", // different version of esbuild - "esbuild": "0.19.8", + esbuild: "0.19.8", }, }), ); diff --git a/test/js/bun/cookie/cookie.test.ts b/test/js/bun/cookie/cookie.test.ts index 0f6ea67fef..778c3f9390 100644 --- a/test/js/bun/cookie/cookie.test.ts +++ b/test/js/bun/cookie/cookie.test.ts @@ -193,7 +193,7 @@ describe("Bun.serve() cookies", () => { ["add_cookie", "d"], ]), headers: { - "Cookie": "dont_modify=a;do_modify=b", + Cookie: "dont_modify=a;do_modify=b", }, }); expect(res.status).toBe(200); @@ -217,7 +217,7 @@ describe("Bun.serve() cookies", () => { method: "POST", body: JSON.stringify([]), headers: { - "Cookie": "dont_modify=a;another_cookie=b", + Cookie: "dont_modify=a;another_cookie=b", }, }); expect(res.status).toBe(200); @@ -290,7 +290,7 @@ describe("Bun.serve() cookies 2", () => { test("server sets cookie", async () => { const response = await fetch(server.url, { headers: { - "Cookie": "abc=def; ghi=jkl", + Cookie: "abc=def; ghi=jkl", }, }); expect(response.headers.getAll("Set-Cookie")).toMatchInlineSnapshot(` @@ -302,7 +302,7 @@ describe("Bun.serve() cookies 2", () => { test("server sets cookie on redirect", async () => { const response = await fetch(server.url + "/redirect", { headers: { - "Cookie": "abc=def; ghi=jkl", + Cookie: "abc=def; ghi=jkl", }, redirect: "manual", }); @@ -406,7 +406,7 @@ describe("Bun.CookieMap constructor", () => { }); test("doesn't parse percent encoded value in object or array", () => { const map = new Bun.CookieMap({ - "cookiekey": "%E8%AF%BB%E5%86%99%E6%B1%89%E5%AD%97%E5%AD%A6%E4%B8%AD%E6%96%87", + cookiekey: "%E8%AF%BB%E5%86%99%E6%B1%89%E5%AD%97%E5%AD%A6%E4%B8%AD%E6%96%87", }); const map2 = new Bun.CookieMap([["cookiekey", "%E8%AF%BB%E5%86%99%E6%B1%89%E5%AD%97%E5%AD%A6%E4%B8%AD%E6%96%87"]]); expect(map.get("cookiekey")).toBe("%E8%AF%BB%E5%86%99%E6%B1%89%E5%AD%97%E5%AD%A6%E4%B8%AD%E6%96%87"); diff --git a/test/js/bun/glob/proto.test.ts b/test/js/bun/glob/proto.test.ts index 8551345e47..08500ab4e5 100644 --- a/test/js/bun/glob/proto.test.ts +++ b/test/js/bun/glob/proto.test.ts @@ -13,14 +13,14 @@ test("Object prototype followSymlinks", async () => { const glob = new Bun.Glob("**/*.txt"); const zero = glob.scanSync({ - "cwd": path.join(dir, "abc"), + cwd: path.join(dir, "abc"), onlyFiles: true, followSymlinks: true, }); expect([...zero].map(a => a.replaceAll("\\", "/")).sort()).toEqual(["def/file.txt", "def/sym/file2.txt"]); const first = glob.scanSync({ - "cwd": path.join(dir, "abc"), + cwd: path.join(dir, "abc"), onlyFiles: true, }); expect([...first].map(a => a.replaceAll("\\", "/"))).toEqual(["def/file.txt"]); @@ -32,14 +32,14 @@ test("Object prototype followSymlinks", async () => { enumerable: true, }); const second = glob.scanSync({ - "cwd": path.join(dir, "abc"), + cwd: path.join(dir, "abc"), onlyFiles: true, }); expect([...second].map(a => a.replaceAll("\\", "/"))).toEqual(["def/file.txt"]); delete Object.prototype.followSymlinks; const third = glob.scanSync({ - "cwd": path.join(dir, "abc"), + cwd: path.join(dir, "abc"), onlyFiles: true, }); expect([...third].map(a => a.replaceAll("\\", "/"))).toEqual(["def/file.txt"]); diff --git a/test/js/bun/glob/scan.test.ts b/test/js/bun/glob/scan.test.ts index db92acf36b..5acfbf9d6c 100644 --- a/test/js/bun/glob/scan.test.ts +++ b/test/js/bun/glob/scan.test.ts @@ -538,22 +538,22 @@ describe("literal fast path", async () => { let tempdir = ""; beforeAll(() => { tempdir = tempDirWithFiles("glob-scan-literal-fast-path", { - "packages": { - "a": { + packages: { + a: { "package.json": "hi", - "foo": "bar", + foo: "bar", }, - "b": { + b: { "package.json": "hi", - "foo": "bar", + foo: "bar", }, - "c": { + c: { "package.json": "hi", - "foo": "bar", + foo: "bar", }, - "foo": "bar", + foo: "bar", }, - "foo": "bar", + foo: "bar", }); }); diff --git a/test/js/bun/http/async-iterator-stream.test.ts b/test/js/bun/http/async-iterator-stream.test.ts index 5a0c7738a9..0154023d6b 100644 --- a/test/js/bun/http/async-iterator-stream.test.ts +++ b/test/js/bun/http/async-iterator-stream.test.ts @@ -196,7 +196,7 @@ describe("Streaming body via", () => { for (let bodyInit of [fn, { [Symbol.asyncIterator]: fn }] as const) { for (let [label, constructFn] of [ ["Response", () => new Response(bodyInit)], - ["Request", () => new Request({ "url": "https://example.com", body: bodyInit })], + ["Request", () => new Request({ url: "https://example.com", body: bodyInit })], ]) { for (let method of ["arrayBuffer", "bytes", "text"]) { test(`${label}(${method})`, async () => { diff --git a/test/js/bun/http/bun-serve-cookies.test.ts b/test/js/bun/http/bun-serve-cookies.test.ts index 45c63f287d..5decb4245a 100644 --- a/test/js/bun/http/bun-serve-cookies.test.ts +++ b/test/js/bun/http/bun-serve-cookies.test.ts @@ -65,7 +65,7 @@ describe("request cookies", () => { it("parses cookies before headers are accessed", async () => { const res = await fetch(`${server.url}before-headers`, { headers: { - "Cookie": "name=value; foo=bar", + Cookie: "name=value; foo=bar", }, }); expect(res.status).toBe(200); @@ -75,7 +75,7 @@ describe("request cookies", () => { it("parses cookies after headers are accessed", async () => { const res = await fetch(`${server.url}after-headers`, { headers: { - "Cookie": "name=value; foo=bar", + Cookie: "name=value; foo=bar", }, }); expect(res.status).toBe(200); @@ -132,7 +132,7 @@ describe("instanceof and type checks", () => { it("cookies is instance of Bun.CookieMap and has right prototype", async () => { const res = await fetch(`${server.url}instanceof-checks`, { headers: { - "Cookie": "name=value", + Cookie: "name=value", }, }); expect(res.status).toBe(200); @@ -141,7 +141,7 @@ describe("instanceof and type checks", () => { it("constructors match expected types", async () => { const res = await fetch(`${server.url}constructor-identities`, { headers: { - "Cookie": "name=value", + Cookie: "name=value", }, }); expect(res.status).toBe(200); @@ -211,7 +211,7 @@ describe("complex cookie parsing", () => { it("handles cookie values with spaces", async () => { const res = await fetch(`${server.url}special-chars`, { headers: { - "Cookie": "complex=value with spaces", + Cookie: "complex=value with spaces", }, }); expect(res.status).toBe(200); @@ -220,7 +220,7 @@ describe("complex cookie parsing", () => { it("handles cookie values with equals signs", async () => { const res = await fetch(`${server.url}equals-in-value`, { headers: { - "Cookie": "equation=x=y+z", + Cookie: "equation=x=y+z", }, }); expect(res.status).toBe(200); @@ -229,7 +229,7 @@ describe("complex cookie parsing", () => { it("handles duplicate cookie names", async () => { const res = await fetch(`${server.url}multiple-cookies`, { headers: { - "Cookie": "duplicate=first; duplicate=second; other=value", + Cookie: "duplicate=first; duplicate=second; other=value", }, }); expect(res.status).toBe(200); @@ -238,7 +238,7 @@ describe("complex cookie parsing", () => { it("CookieMap methods work correctly", async () => { const res = await fetch(`${server.url}cookie-map-methods`, { headers: { - "Cookie": "name=value; foo=bar", + Cookie: "name=value; foo=bar", }, }); expect(res.status).toBe(200); @@ -355,7 +355,7 @@ describe("CookieMap iterator", () => { it("implements entries() iterator", async () => { const res = await fetch(`${server.url}iterator-entries`, { headers: { - "Cookie": "a=1; b=2; c=3", + Cookie: "a=1; b=2; c=3", }, }); expect(res.status).toBe(200); @@ -364,7 +364,7 @@ describe("CookieMap iterator", () => { it("implements for...of iteration", async () => { const res = await fetch(`${server.url}iterator-for-of`, { headers: { - "Cookie": "a=1; b=2; c=3", + Cookie: "a=1; b=2; c=3", }, }); expect(res.status).toBe(200); @@ -373,7 +373,7 @@ describe("CookieMap iterator", () => { it("implements keys() and values() iterators", async () => { const res = await fetch(`${server.url}iterator-keys-values`, { headers: { - "Cookie": "a=1; b=2; c=3", + Cookie: "a=1; b=2; c=3", }, }); expect(res.status).toBe(200); @@ -382,7 +382,7 @@ describe("CookieMap iterator", () => { it("implements forEach method", async () => { const res = await fetch(`${server.url}iterator-forEach`, { headers: { - "Cookie": "a=1; b=2; c=3", + Cookie: "a=1; b=2; c=3", }, }); expect(res.status).toBe(200); diff --git a/test/js/bun/http/bun-serve-file.test.ts b/test/js/bun/http/bun-serve-file.test.ts index 7ae64be35c..ee5eaa7d7d 100644 --- a/test/js/bun/http/bun-serve-file.test.ts +++ b/test/js/bun/http/bun-serve-file.test.ts @@ -277,7 +277,7 @@ describe("Bun.file in serve routes", () => { it("supports partial content requests", async () => { const res = await fetch(new URL(`/hello.txt`, server.url), { headers: { - "Range": "bytes=0-4", + Range: "bytes=0-4", }, }); @@ -295,7 +295,7 @@ describe("Bun.file in serve routes", () => { it("handles invalid range requests", async () => { const res = await fetch(new URL(`/hello.txt`, server.url), { headers: { - "Range": "bytes=20-30", // Beyond file size + Range: "bytes=20-30", // Beyond file size }, }); diff --git a/test/js/bun/http/bun-server.test.ts b/test/js/bun/http/bun-server.test.ts index 7a0355da8d..a101e97917 100644 --- a/test/js/bun/http/bun-server.test.ts +++ b/test/js/bun/http/bun-server.test.ts @@ -9,7 +9,7 @@ describe("Server", () => { fetch(request) { return new Response(request.url, { headers: { - "Connection": "close", + Connection: "close", }, }); }, @@ -549,7 +549,7 @@ test("should be able to await server.stop()", async () => { return new Response("Hello World", { headers: { // Prevent Keep-Alive from keeping the connection open - "Connection": "close", + Connection: "close", }, }); }, @@ -965,7 +965,7 @@ describe("HEAD requests #15355", () => { test("HEAD requests should not have body", async () => { const dir = tempDirWithFiles("fsr", { - "hello": "Hello World", + hello: "Hello World", }); const filename = path.join(dir, "hello"); diff --git a/test/js/bun/http/proxy.test.js b/test/js/bun/http/proxy.test.js index 19ca789e6f..2350a7b8cd 100644 --- a/test/js/bun/http/proxy.test.js +++ b/test/js/bun/http/proxy.test.js @@ -80,7 +80,7 @@ const test = process.env.PROXY_URL ? it : it.skip; test("should be able to post on TLS", async () => { const data = JSON.stringify({ - "name": "bun", + name: "bun", }); const result = await fetch("https://httpbin.org/post", { diff --git a/test/js/bun/http/serve-if-none-match.test.ts b/test/js/bun/http/serve-if-none-match.test.ts index 1362435aa2..e71fba053d 100644 --- a/test/js/bun/http/serve-if-none-match.test.ts +++ b/test/js/bun/http/serve-if-none-match.test.ts @@ -13,13 +13,13 @@ describe("If-None-Match Support", () => { "/with-etag": new Response("Custom content", { headers: { "Content-Type": "text/plain", - "ETag": '"custom-etag"', + ETag: '"custom-etag"', }, }), "/weak-etag": new Response("Weak content", { headers: { "Content-Type": "text/plain", - "ETag": 'W/"weak-etag"', + ETag: 'W/"weak-etag"', }, }), }; diff --git a/test/js/bun/http/serve.test.ts b/test/js/bun/http/serve.test.ts index f3f74d8e62..3f782bb8c3 100644 --- a/test/js/bun/http/serve.test.ts +++ b/test/js/bun/http/serve.test.ts @@ -199,7 +199,7 @@ for (let withDelay of [true, false]) { ? {} : { headers: { - "Connection": "close", + Connection: "close", }, keepalive: false, }, @@ -2091,7 +2091,7 @@ it("#6462", async () => { } return new Response( JSON.stringify({ - "headers": headers, + headers: headers, }), { status: 200 }, ); diff --git a/test/js/bun/ini/ini.test.ts b/test/js/bun/ini/ini.test.ts index 14667b673f..a9515a5f31 100644 --- a/test/js/bun/ini/ini.test.ts +++ b/test/js/bun/ini/ini.test.ts @@ -10,7 +10,7 @@ describe("parse ini", () => { lol = true `; - expect(parse(ini)).toEqual({ "[foo\\]]": true, "lol": true }); + expect(parse(ini)).toEqual({ "[foo\\]]": true, lol: true }); }); test("really long input", () => { @@ -243,86 +243,86 @@ brr = 3 expect(result).toEqual({ " xa n p ": '"\r\nyoyoyo\r\r\n', "[disturbing]": "hey you never know", - "a": { + a: { "[]": "a square?", - "av": "a val", - "b": { - "c": { - "e": "1", - "j": "2", + av: "a val", + b: { + c: { + e: "1", + j: "2", }, }, - "cr": ["four", "eight"], - "e": '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', - "j": '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"', + cr: ["four", "eight"], + e: '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', + j: '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"', }, "a with spaces": "b c", - "ar": ["one", "three", "this is included"], - "b": {}, - "br": "warm", - "eq": "eq=eq", - "false": false, - "null": null, - "o": "p", - "s": "something", - "s1": "\"something'", - "s2": "something else", - "s3": "", - "s4": "", - "s5": " ", - "s6": " a ", - "s7": true, - "true": true, - "undefined": "undefined", + ar: ["one", "three", "this is included"], + b: {}, + br: "warm", + eq: "eq=eq", + false: false, + null: null, + o: "p", + s: "something", + s1: "\"something'", + s2: "something else", + s3: "", + s4: "", + s5: " ", + s6: " a ", + s7: true, + true: true, + undefined: "undefined", "x.y.z": { "a.b.c": { "a.b.c": "abc", - "nocomment": "this; this is not a comment", - "noHashComment": "this# this is not a comment", + nocomment: "this; this is not a comment", + noHashComment: "this# this is not a comment", }, "x.y.z": "xyz", }, - "zr": ["deedee"], + zr: ["deedee"], }); }); }); const wtf = { - "o": "p", + o: "p", "a with spaces": "b c", " xa n p ": '"\r\nyoyoyo\r\r\n', "[disturbing]": "hey you never know", - "s": "something", - "s1": "\"something'", - "s2": "something else", - "s3": true, - "s4": true, - "s5": " ", - "s6": " a ", - "s7": true, - "true": true, - "false": false, - "null": null, - "undefined": "undefined", - "zr": ["deedee"], - "ar": [["one"], "three", "this is included"], - "br": "warm", - "eq": "eq=eq", - "a": { - "av": "a val", - "e": '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', - "j": '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"', + s: "something", + s1: "\"something'", + s2: "something else", + s3: true, + s4: true, + s5: " ", + s6: " a ", + s7: true, + true: true, + false: false, + null: null, + undefined: "undefined", + zr: ["deedee"], + ar: [["one"], "three", "this is included"], + br: "warm", + eq: "eq=eq", + a: { + av: "a val", + e: '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', + j: '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"', "[]": "a square?", - "cr": [["four"], "eight"], - "b": { "c": { "e": "1", "j": "2" } }, + cr: [["four"], "eight"], + b: { c: { e: "1", j: "2" } }, }, - "b": {}, + b: {}, "x.y.z": { "x.y.z": "xyz", "a.b.c": { "a.b.c": "abc", - "nocomment": "this; this is not a comment", - "noHashComment": "this# this is not a comment", + nocomment: "this; this is not a comment", + noHashComment: "this# this is not a comment", }, }, }; diff --git a/test/js/bun/patch/patch.test.ts b/test/js/bun/patch/patch.test.ts index 327f7099db..c7c8cb78bd 100644 --- a/test/js/bun/patch/patch.test.ts +++ b/test/js/bun/patch/patch.test.ts @@ -148,7 +148,7 @@ describe("apply", () => { describe("creation", () => { test("simple", async () => { const files = { - "a": {}, + a: {}, "b/newfile.txt": "hey im new here!", }; const tempdir = tempDirWithFiles("patch-test", files); @@ -165,7 +165,7 @@ describe("apply", () => { test("multi-line", async () => { const files = { - "a": {}, + a: {}, "b/newfile.txt": "hey im new here!\nhello", }; const tempdir = tempDirWithFiles("patch-test", files); @@ -479,44 +479,44 @@ describe("apply", () => { describe("parse", () => { test("works for a simple case", () => { expect(removeCapacity(JSON.parse(parse(patch)))).toEqual({ - "parts": { - "items": [ + parts: { + items: [ { - "file_patch": { - "path": "banana.ts", - "hunks": { - "items": [ + file_patch: { + path: "banana.ts", + hunks: { + items: [ { - "header": { "original": { "start": 1, "len": 5 }, "patched": { "start": 1, "len": 5 } }, - "parts": { - "items": [ + header: { original: { start: 1, len: 5 }, patched: { start: 1, len: 5 } }, + parts: { + items: [ { - "type": "context", - "lines": { "items": ["this", "is", ""] }, - "no_newline_at_end_of_file": false, + type: "context", + lines: { items: ["this", "is", ""] }, + no_newline_at_end_of_file: false, }, { - "type": "deletion", - "lines": { "items": ["a"] }, - "no_newline_at_end_of_file": false, + type: "deletion", + lines: { items: ["a"] }, + no_newline_at_end_of_file: false, }, { - "type": "insertion", - "lines": { "items": [""] }, - "no_newline_at_end_of_file": false, + type: "insertion", + lines: { items: [""] }, + no_newline_at_end_of_file: false, }, { - "type": "context", - "lines": { "items": ["file"] }, - "no_newline_at_end_of_file": false, + type: "context", + lines: { items: ["file"] }, + no_newline_at_end_of_file: false, }, ], }, }, ], }, - "before_hash": "2de83dd", - "after_hash": "842652c", + before_hash: "2de83dd", + after_hash: "842652c", }, }, ], @@ -538,25 +538,25 @@ describe("parse", () => { test(`can handle files with CRLF line breaks`, () => { expect(removeCapacity(JSON.parse(parse(crlfLineBreaks)))).toEqual({ - "parts": { - "items": [ + parts: { + items: [ { - "file_creation": { - "path": "banana.ts", - "mode": "non_executable", - "hunk": { - "header": { "original": { "start": 1, "len": 0 }, "patched": { "start": 1, "len": 1 } }, - "parts": { - "items": [ + file_creation: { + path: "banana.ts", + mode: "non_executable", + hunk: { + header: { original: { start: 1, len: 0 }, patched: { start: 1, len: 1 } }, + parts: { + items: [ { - "type": "insertion", - "lines": { "items": ["this is a new file\r"] }, - "no_newline_at_end_of_file": false, + type: "insertion", + lines: { items: ["this is a new file\r"] }, + no_newline_at_end_of_file: false, }, ], }, }, - "hash": "3e1267f", + hash: "3e1267f", }, }, ], @@ -566,41 +566,41 @@ describe("parse", () => { test("works", () => { expect(removeCapacity(JSON.parse(parse(modeChangeAndModifyAndRename)))).toEqual({ - "parts": { - "items": [ - { "file_rename": { "from_path": "numbers.txt", "to_path": "banana.txt" } }, - { "file_mode_change": { "path": "banana.txt", "old_mode": "non_executable", "new_mode": "executable" } }, + parts: { + items: [ + { file_rename: { from_path: "numbers.txt", to_path: "banana.txt" } }, + { file_mode_change: { path: "banana.txt", old_mode: "non_executable", new_mode: "executable" } }, { - "file_patch": { - "path": "banana.txt", - "hunks": { - "items": [ + file_patch: { + path: "banana.txt", + hunks: { + items: [ { - "header": { "original": { "start": 1, "len": 4 }, "patched": { "start": 1, "len": 4 } }, - "parts": { - "items": [ + header: { original: { start: 1, len: 4 }, patched: { start: 1, len: 4 } }, + parts: { + items: [ { - "type": "deletion", - "lines": { "items": ["one"] }, - "no_newline_at_end_of_file": false, + type: "deletion", + lines: { items: ["one"] }, + no_newline_at_end_of_file: false, }, { - "type": "insertion", - "lines": { "items": ["ne"] }, - "no_newline_at_end_of_file": false, + type: "insertion", + lines: { items: ["ne"] }, + no_newline_at_end_of_file: false, }, { - "type": "context", - "lines": { "items": ["", "two", ""] }, - "no_newline_at_end_of_file": false, + type: "context", + lines: { items: ["", "two", ""] }, + no_newline_at_end_of_file: false, }, ], }, }, ], }, - "before_hash": "fbf1785", - "after_hash": "92d2c5f", + before_hash: "fbf1785", + after_hash: "92d2c5f", }, }, ], @@ -610,140 +610,140 @@ describe("parse", () => { test("parses old-style patches", () => { expect(removeCapacity(JSON.parse(parse(oldStylePatch)))).toEqual({ - "parts": { - "items": [ + parts: { + items: [ { - "file_patch": { - "path": "node_modules/graphql/utilities/assertValidName.js", - "hunks": { - "items": [ + file_patch: { + path: "node_modules/graphql/utilities/assertValidName.js", + hunks: { + items: [ { - "header": { "original": { "start": 41, "len": 10 }, "patched": { "start": 41, "len": 11 } }, - "parts": { - "items": [ + header: { original: { start: 41, len: 10 }, patched: { start: 41, len: 11 } }, + parts: { + items: [ { - "type": "context", - "lines": { - "items": [ + type: "context", + lines: { + items: [ " */", "function isValidNameError(name, node) {", " !(typeof name === 'string') ? (0, _invariant2.default)(0, 'Expected string') : void 0;", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "deletion", - "lines": { - "items": [ + type: "deletion", + lines: { + items: [ " if (name.length > 1 && name[0] === '_' && name[1] === '_') {", " return new _GraphQLError.GraphQLError('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection.', node);", " }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "insertion", - "lines": { - "items": [ + type: "insertion", + lines: { + items: [ " // if (name.length > 1 && name[0] === '_' && name[1] === '_') {", " // return new _GraphQLError.GraphQLError('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection.', node);", " // }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "context", - "lines": { - "items": [ + type: "context", + lines: { + items: [ " if (!NAME_RX.test(name)) {", " return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.', node);", " }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "insertion", - "lines": { "items": [""] }, - "no_newline_at_end_of_file": false, + type: "insertion", + lines: { items: [""] }, + no_newline_at_end_of_file: false, }, { - "type": "context", - "lines": { "items": ["}"] }, - "no_newline_at_end_of_file": true, + type: "context", + lines: { items: ["}"] }, + no_newline_at_end_of_file: true, }, ], }, }, ], }, - "before_hash": null, - "after_hash": null, + before_hash: null, + after_hash: null, }, }, { - "file_patch": { - "path": "node_modules/graphql/utilities/assertValidName.mjs", - "hunks": { - "items": [ + file_patch: { + path: "node_modules/graphql/utilities/assertValidName.mjs", + hunks: { + items: [ { - "header": { "original": { "start": 29, "len": 9 }, "patched": { "start": 29, "len": 9 } }, - "parts": { - "items": [ + header: { original: { start: 29, len: 9 }, patched: { start: 29, len: 9 } }, + parts: { + items: [ { - "type": "context", - "lines": { - "items": [ + type: "context", + lines: { + items: [ " */", "export function isValidNameError(name, node) {", " !(typeof name === 'string') ? invariant(0, 'Expected string') : void 0;", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "deletion", - "lines": { - "items": [ + type: "deletion", + lines: { + items: [ " if (name.length > 1 && name[0] === '_' && name[1] === '_') {", " return new GraphQLError('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection.', node);", " }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "insertion", - "lines": { - "items": [ + type: "insertion", + lines: { + items: [ " // if (name.length > 1 && name[0] === '_' && name[1] === '_') {", " // return new GraphQLError('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection.', node);", " // }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, { - "type": "context", - "lines": { - "items": [ + type: "context", + lines: { + items: [ " if (!NAME_RX.test(name)) {", " return new GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.', node);", " }", ], }, - "no_newline_at_end_of_file": false, + no_newline_at_end_of_file: false, }, ], }, }, ], }, - "before_hash": null, - "after_hash": null, + before_hash: null, + after_hash: null, }, }, ], diff --git a/test/js/bun/s3/s3-storage-class.test.ts b/test/js/bun/s3/s3-storage-class.test.ts index 285bc032c9..d97914097e 100644 --- a/test/js/bun/s3/s3-storage-class.test.ts +++ b/test/js/bun/s3/s3-storage-class.test.ts @@ -229,7 +229,7 @@ describe("s3 - Storage class", () => { ); } - return new Response(undefined, { status: 200, headers: { "Etag": `"f9a5ddddf9e0fcbd05c15bb44b389171-20"` } }); + return new Response(undefined, { status: 200, headers: { Etag: `"f9a5ddddf9e0fcbd05c15bb44b389171-20"` } }); }, }); diff --git a/test/js/bun/s3/s3.test.ts b/test/js/bun/s3/s3.test.ts index 18823320ee..4cdb6724bf 100644 --- a/test/js/bun/s3/s3.test.ts +++ b/test/js/bun/s3/s3.test.ts @@ -265,7 +265,7 @@ for (let credentials of allCredentials) { it("should download range", async () => { const result = await fetch(tmp_filename, { - headers: { "range": "bytes=6-10" }, + headers: { range: "bytes=6-10" }, s3: options, }); expect(result.status).toBe(206); @@ -1362,9 +1362,9 @@ describe.skipIf(!minioCredentials)("minio", () => { const { stdout, stderr } = await bunRun(path.join(testDir, "index.mjs"), { // @ts-ignore [endpoint]: minioCredentials!.endpoint as string, - "S3_BUCKET": minioCredentials!.bucket as string, - "S3_ACCESS_KEY_ID": minioCredentials!.accessKeyId as string, - "S3_SECRET_ACCESS_KEY": minioCredentials!.secretAccessKey as string, + S3_BUCKET: minioCredentials!.bucket as string, + S3_ACCESS_KEY_ID: minioCredentials!.accessKeyId as string, + S3_SECRET_ACCESS_KEY: minioCredentials!.secretAccessKey as string, }); expect(stderr).toBe(""); expect(stdout).toBe("Hello Bun!"); diff --git a/test/js/bun/shell/commands/cp.test.ts b/test/js/bun/shell/commands/cp.test.ts index 80a28d2c7e..a514da6d32 100644 --- a/test/js/bun/shell/commands/cp.test.ts +++ b/test/js/bun/shell/commands/cp.test.ts @@ -92,13 +92,13 @@ describe.if(!builtinDisabled("cp"))("bunshell cp", async () => { "hello_world.txt": "Hello, World!", "existing_file.txt": "Cogito ergo sum.", "how_are_you.txt": "How are you?", - "hello_dir": { + hello_dir: { "hello.txt": "", }, - "hello_dir_with_file": { + hello_dir_with_file: { "hello_world.txt": "Hello, World!", }, - "dir_with_10_files": { + dir_with_10_files: { "0": "", "1": "", "2": "", diff --git a/test/js/bun/shell/commands/rm.test.ts b/test/js/bun/shell/commands/rm.test.ts index 114b4a9ece..25a9361aaa 100644 --- a/test/js/bun/shell/commands/rm.test.ts +++ b/test/js/bun/shell/commands/rm.test.ts @@ -117,7 +117,7 @@ foo/ test("dir", async () => { const files = { "existent.txt": "", - "sub_dir": {}, + sub_dir: {}, "sub_dir_files/file.txt": "", }; diff --git a/test/js/bun/shell/lex.test.ts b/test/js/bun/shell/lex.test.ts index 9fb79d60bc..136bc5249b 100644 --- a/test/js/bun/shell/lex.test.ts +++ b/test/js/bun/shell/lex.test.ts @@ -10,28 +10,28 @@ $.nothrow(); describe("lex shell", () => { test("basic", () => { - const expected = [{ "Text": "next" }, { "Delimit": {} }, { "Text": "dev" }, { "Delimit": {} }, { "Eof": {} }]; + const expected = [{ Text: "next" }, { Delimit: {} }, { Text: "dev" }, { Delimit: {} }, { Eof: {} }]; const result = JSON.parse(lex`next dev`); expect(result).toEqual(expected); }); test("var edgecase", () => { expect(JSON.parse(lex`$PWD/test.txt`)).toEqual([ - { "Var": "PWD" }, - { "Text": "/test.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Var: "PWD" }, + { Text: "/test.txt" }, + { Delimit: {} }, + { Eof: {} }, ]); }); test("vars", () => { const expected = [ - { "Text": "next" }, - { "Delimit": {} }, - { "Text": "dev" }, - { "Delimit": {} }, - { "Var": "PORT" }, - { "Eof": {} }, + { Text: "next" }, + { Delimit: {} }, + { Text: "dev" }, + { Delimit: {} }, + { Var: "PORT" }, + { Eof: {} }, ]; const result = JSON.parse(lex`next dev $PORT`); expect(result).toEqual(expected); @@ -39,12 +39,12 @@ describe("lex shell", () => { test("quoted_var", () => { const expected = [ - { "Text": "next" }, - { "Delimit": {} }, - { "Text": "dev" }, - { "Delimit": {} }, - { "Var": "PORT" }, - { "Eof": {} }, + { Text: "next" }, + { Delimit: {} }, + { Text: "dev" }, + { Delimit: {} }, + { Var: "PORT" }, + { Eof: {} }, ]; const result = JSON.parse(lex`next dev "$PORT"`); expect(result).toEqual(expected); @@ -52,13 +52,13 @@ describe("lex shell", () => { test("quoted_edge_case", () => { const expected = [ - { "Text": "next" }, - { "Delimit": {} }, - { "Text": "dev" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Var": "PORT" }, - { "Eof": {} }, + { Text: "next" }, + { Delimit: {} }, + { Text: "dev" }, + { Delimit: {} }, + { Text: "foo" }, + { Var: "PORT" }, + { Eof: {} }, ]; const result = JSON.parse(lex`next dev foo"$PORT"`); expect(result).toEqual(expected); @@ -66,13 +66,13 @@ describe("lex shell", () => { test("quote_multi", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Var": "NICE" }, - { "Text": "good" }, - { "DoubleQuotedText": "NICE" }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Var: "NICE" }, + { Text: "good" }, + { DoubleQuotedText: "NICE" }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo"$NICE"good"NICE"`); expect(result).toEqual(expected); @@ -80,20 +80,20 @@ describe("lex shell", () => { test("semicolon", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, - { "Semicolon": {} }, - { "Text": "bar" }, - { "Delimit": {} }, - { "Text": "baz" }, - { "Delimit": {} }, - { "Semicolon": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "DoubleQuotedText": "NICE;" }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, + { Semicolon: {} }, + { Text: "bar" }, + { Delimit: {} }, + { Text: "baz" }, + { Delimit: {} }, + { Semicolon: {} }, + { Text: "echo" }, + { Delimit: {} }, + { DoubleQuotedText: "NICE;" }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo; bar baz; echo "NICE;"`); expect(result).toEqual(expected); @@ -101,13 +101,13 @@ describe("lex shell", () => { test("single_quote", () => { const expected = [ - { "Text": "next" }, - { "Delimit": {} }, - { "Text": "dev" }, - { "Delimit": {} }, - { "Text": "hello how is it going" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "next" }, + { Delimit: {} }, + { Text: "dev" }, + { Delimit: {} }, + { Text: "hello how is it going" }, + { Delimit: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`next dev 'hello how is it going'`); expect(result).toEqual(expected); @@ -115,19 +115,19 @@ describe("lex shell", () => { test("env_vars", () => { const expected = [ - { "Text": "NAME=zack" }, - { "Delimit": {} }, - { "Text": "FULLNAME=" }, - { "Var": "NAME" }, - { "DoubleQuotedText": " radisic" }, - { "Delimit": {} }, - { "Text": "LOL=" }, - { "Delimit": {} }, - { "Semicolon": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "Var": "FULLNAME" }, - { "Eof": {} }, + { Text: "NAME=zack" }, + { Delimit: {} }, + { Text: "FULLNAME=" }, + { Var: "NAME" }, + { DoubleQuotedText: " radisic" }, + { Delimit: {} }, + { Text: "LOL=" }, + { Delimit: {} }, + { Semicolon: {} }, + { Text: "echo" }, + { Delimit: {} }, + { Var: "FULLNAME" }, + { Eof: {} }, ]; const result = JSON.parse(lex`NAME=zack FULLNAME="$NAME radisic" LOL= ; echo $FULLNAME`); expect(result).toEqual(expected); @@ -208,18 +208,18 @@ describe("lex shell", () => { test("brace_expansion", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "BraceBegin": {} }, - { "Text": "ts" }, - { "Comma": {} }, - { "Text": "tsx" }, - { "Comma": {} }, - { "Text": "js" }, - { "Comma": {} }, - { "Text": "jsx" }, - { "BraceEnd": {} }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { BraceBegin: {} }, + { Text: "ts" }, + { Comma: {} }, + { Text: "tsx" }, + { Comma: {} }, + { Text: "js" }, + { Comma: {} }, + { Text: "jsx" }, + { BraceEnd: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo {ts,tsx,js,jsx}`); expect(result).toEqual(expected); @@ -227,16 +227,16 @@ describe("lex shell", () => { test("op_and", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, - { "DoubleAmpersand": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "bar" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, + { DoubleAmpersand: {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "bar" }, + { Delimit: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo && echo bar`); expect(result).toEqual(expected); @@ -244,16 +244,16 @@ describe("lex shell", () => { test("op_or", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, - { "DoublePipe": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "bar" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, + { DoublePipe: {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "bar" }, + { Delimit: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo || echo bar`); expect(result).toEqual(expected); @@ -261,16 +261,16 @@ describe("lex shell", () => { test("op_pipe", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, - { "Pipe": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "bar" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, + { Pipe: {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "bar" }, + { Delimit: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo | echo bar`); expect(result).toEqual(expected); @@ -278,16 +278,16 @@ describe("lex shell", () => { test("op_bg", () => { const expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, - { "Ampersand": {} }, - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "bar" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, + { Ampersand: {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "bar" }, + { Delimit: {} }, + { Eof: {} }, ]; const result = JSON.parse(lex`echo foo & echo bar`); expect(result).toEqual(expected); @@ -295,158 +295,158 @@ describe("lex shell", () => { test("op_redirect", () => { let expected = [ - { "Text": "echo" }, - { "Delimit": {} }, - { "Text": "foo" }, - { "Delimit": {} }, + { Text: "echo" }, + { Delimit: {} }, + { Text: "foo" }, + { Delimit: {} }, { - "Redirect": redirect({ stdout: true }), + Redirect: redirect({ stdout: true }), }, - { "Text": "cat" }, - { "Delimit": {} }, - { "Text": "secrets.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "cat" }, + { Delimit: {} }, + { Text: "secrets.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; let result = JSON.parse(lex`echo foo > cat secrets.txt`); expect(result).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": true, - "stdout": false, - "stderr": false, - "append": false, + Redirect: { + stdin: true, + stdout: false, + stderr: false, + append: false, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 0> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": true, - "stderr": false, - "append": false, + Redirect: { + stdin: false, + stdout: true, + stderr: false, + append: false, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 1> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": false, - "stderr": true, - "append": false, + Redirect: { + stdin: false, + stdout: false, + stderr: true, + append: false, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 2> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": true, - "stderr": true, - "append": false, + Redirect: { + stdin: false, + stdout: true, + stderr: true, + append: false, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 &> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": true, - "stderr": false, - "append": true, + Redirect: { + stdin: false, + stdout: true, + stderr: false, + append: true, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 1>> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": false, - "stderr": true, - "append": true, + Redirect: { + stdin: false, + stdout: false, + stderr: true, + append: true, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 2>> file.txt`; expect(JSON.parse(result)).toEqual(expected); expected = [ - { "Text": "cmd1" }, - { "Delimit": {} }, + { Text: "cmd1" }, + { Delimit: {} }, { - "Redirect": { - "stdin": false, - "stdout": true, - "stderr": true, - "append": true, + Redirect: { + stdin: false, + stdout: true, + stderr: true, + append: true, duplicate_out: false, - "__unused": 0, + __unused: 0, }, }, - { "Text": "file.txt" }, - { "Delimit": {} }, - { "Eof": {} }, + { Text: "file.txt" }, + { Delimit: {} }, + { Eof: {} }, ]; result = lex`cmd1 &>> file.txt`; expect(JSON.parse(result)).toEqual(expected); diff --git a/test/js/bun/shell/parse.test.ts b/test/js/bun/shell/parse.test.ts index a091858e9d..c189154d30 100644 --- a/test/js/bun/shell/parse.test.ts +++ b/test/js/bun/shell/parse.test.ts @@ -477,70 +477,70 @@ describe("parse shell", () => { describe("if_clause", () => { test("basic", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "if": { - "cond": [ + if: { + cond: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "hi" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "hi" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "then": [ + then: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "lmao" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "lmao" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "else_parts": [ + else_parts: [ [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "lol" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "lol" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -565,70 +565,70 @@ describe("parse shell", () => { test("elif", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "if": { - "cond": [ + if: { + cond: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "a" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "a" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "then": [ + then: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "b" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "b" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "else_parts": [ + else_parts: [ [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "c" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "c" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -636,20 +636,20 @@ describe("parse shell", () => { ], [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "d" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "d" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -657,20 +657,20 @@ describe("parse shell", () => { ], [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "e" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "e" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -691,79 +691,73 @@ describe("parse shell", () => { describe("precedence", () => { test("in pipeline", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "pipeline": { - "items": [ + pipeline: { + items: [ { - "if": { - "cond": [ + if: { + cond: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "hi" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "hi" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "then": [ + then: [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [ - { "simple": { "Text": "echo" } }, - { "simple": { "Text": "lmao" } }, - ], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "lmao" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], }, ], - "else_parts": [ + else_parts: [ [ { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [], - "name_and_args": [ - { "simple": { "Text": "echo" } }, - { "simple": { "Text": "lol" } }, - ], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "lol" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -773,18 +767,18 @@ describe("parse shell", () => { }, }, { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "cat" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "cat" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -812,41 +806,41 @@ describe("parse shell", () => { test("right side of binary works", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "binary": { - "op": "And", - "left": { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "hi" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + binary: { + op: "And", + left: { + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "hi" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, - "right": { - "async": { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "foo" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + right: { + async: { + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "foo" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, }, @@ -863,41 +857,41 @@ describe("parse shell", () => { test("pipeline", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "async": { - "pipeline": { - "items": [ + async: { + pipeline: { + items: [ { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "hi" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "hi" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, { - "cmd": { - "assigns": [], - "name_and_args": [{ "simple": { "Text": "echo" } }, { "simple": { "Text": "foo" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [], + name_and_args: [{ simple: { Text: "echo" } }, { simple: { Text: "foo" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], @@ -982,32 +976,32 @@ describe("parse shell", () => { test("cmd edgecase", () => { const expected = { - "stmts": [ + stmts: [ { - "exprs": [ + exprs: [ { - "assign": [ - { "label": "FOO", "value": { "simple": { "Text": "bar" } } }, - { "label": "BAR", "value": { "simple": { "Text": "baz" } } }, + assign: [ + { label: "FOO", value: { simple: { Text: "bar" } } }, + { label: "BAR", value: { simple: { Text: "baz" } } }, ], }, ], }, { - "exprs": [ + exprs: [ { - "cmd": { - "assigns": [{ "label": "BUN_DEBUG_QUIET_LOGS", "value": { "simple": { "Text": "1" } } }], - "name_and_args": [{ "simple": { "Text": "echo" } }], - "redirect": { - "stdin": false, - "stdout": false, - "stderr": false, - "append": false, - "duplicate_out": false, - "__unused": 0, + cmd: { + assigns: [{ label: "BUN_DEBUG_QUIET_LOGS", value: { simple: { Text: "1" } } }], + name_and_args: [{ simple: { Text: "echo" } }], + redirect: { + stdin: false, + stdout: false, + stderr: false, + append: false, + duplicate_out: false, + __unused: 0, }, - "redirect_file": null, + redirect_file: null, }, }, ], diff --git a/test/js/bun/spawn/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts index 7cf2780fc7..893b5afec4 100644 --- a/test/js/bun/spawn/spawn.test.ts +++ b/test/js/bun/spawn/spawn.test.ts @@ -541,8 +541,8 @@ it.skipIf(Boolean(process.env.BUN_FEATURE_FLAG_FORCE_WAITER_THREAD) || !isPosix env: { ...bunEnv, // Both flags are necessary to force this condition - "BUN_FEATURE_FLAG_FORCE_WAITER_THREAD": "1", - "BUN_GARBAGE_COLLECTOR_LEVEL": "1", + BUN_FEATURE_FLAG_FORCE_WAITER_THREAD: "1", + BUN_GARBAGE_COLLECTOR_LEVEL: "1", }, stderr: "inherit", stdout: "inherit", diff --git a/test/js/bun/sqlite/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js index d00a9c01f0..c08a31c11e 100644 --- a/test/js/bun/sqlite/sqlite.test.js +++ b/test/js/bun/sqlite/sqlite.test.js @@ -178,7 +178,7 @@ describe("safeIntegers", () => { const query = db.query("INSERT INTO cats (name, age) VALUES (@name, @age)"); query[method]({ - "name": "Joey", + name: "Joey", }); }).toThrow('Missing parameter "age"'); }); @@ -760,8 +760,8 @@ it("strict: true", () => { db.exec("CREATE TABLE cats (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT UNIQUE NOT NULL, age INTEGER NOT NULL)"); const insert = db.query("INSERT INTO cats (name, age) VALUES (@name, @age) RETURNING name").all({ - "name": "Joey", - "age": 2, + name: "Joey", + age: 2, }); }); diff --git a/test/js/bun/test/expect.test.js b/test/js/bun/test/expect.test.js index 53b5cf60ca..6618480e5f 100644 --- a/test/js/bun/test/expect.test.js +++ b/test/js/bun/test/expect.test.js @@ -289,10 +289,10 @@ describe("expect()", () => { } test("Headers", () => { - expect(new Headers({ "a": "1" })).toEqual(new Headers({ "a": "1" })); - expect(new Headers({ "a": "1" })).not.toEqual(new Headers({ "b": "1" })); - expect(new Headers({ "a": "1" })).not.toEqual(new Headers({ "a": "2" })); - expect(new Headers({ "a": "1" })).not.toEqual(new Headers({ "a": "1", "b": "2" })); + expect(new Headers({ a: "1" })).toEqual(new Headers({ a: "1" })); + expect(new Headers({ a: "1" })).not.toEqual(new Headers({ b: "1" })); + expect(new Headers({ a: "1" })).not.toEqual(new Headers({ a: "2" })); + expect(new Headers({ a: "1" })).not.toEqual(new Headers({ a: "1", b: "2" })); }); // TODO: FormData diff --git a/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts b/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts index 9d9d027d08..04d9b88427 100644 --- a/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts +++ b/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts @@ -946,10 +946,10 @@ test("write snapshot from filter", async () => { }) `; const dir = tempDirWithFiles("writesnapshotfromfilter", { - "mytests": { + mytests: { "snap.test.ts": sver("a", false), "snap2.test.ts": sver("b", false), - "more": { + more: { "testing.test.ts": sver("TEST", false), }, }, diff --git a/test/js/bun/util/bun-cryptohasher.test.ts b/test/js/bun/util/bun-cryptohasher.test.ts index aa159a65e6..296705aee3 100644 --- a/test/js/bun/util/bun-cryptohasher.test.ts +++ b/test/js/bun/util/bun-cryptohasher.test.ts @@ -18,15 +18,15 @@ test("CryptoHasher update should throw when no parameter/null/undefined is passe describe("HMAC", () => { const hashes = { - "sha1": "e2e1f7f597941d9b0021978618218a9e08731426", - "sha256": "c7a7c96c73af32ea6e5b1ca6768b1d822249eb88f85160433d7b09bb2b21e170", - "sha384": "2483522dcb7cb65fa13f0a3c1efe867abbd79ecb19a6ba4bac45d4f4bac31de2e2463b11838b8055601fad73d0b5af4c", - "sha512": + sha1: "e2e1f7f597941d9b0021978618218a9e08731426", + sha256: "c7a7c96c73af32ea6e5b1ca6768b1d822249eb88f85160433d7b09bb2b21e170", + sha384: "2483522dcb7cb65fa13f0a3c1efe867abbd79ecb19a6ba4bac45d4f4bac31de2e2463b11838b8055601fad73d0b5af4c", + sha512: "f82266c950db24eba03f899466fdf905494709f09f98f4b7d7db31f1443a33b4fe5ca82f74fb360609d8a05a87fb065dd77bee912c27de89cbba7897061ac735", - "blake2b512": + blake2b512: "9e66ba10f4d7e80abc2584150fc5f9a246634118280fd9ae086794d37cb9919d681ee285b68f9cec2eda9f878d157125cc465c8b0e3c023a7040ed0be7f25023", - "md5": "4e7eb9f9332e4eb1dc5a2d7d065ba1bf", - "sha224": "d34c3a2647d4f82a4e6baeaa7d94379eafd931e0c16cbc44b4ba4d1e", + md5: "4e7eb9f9332e4eb1dc5a2d7d065ba1bf", + sha224: "d34c3a2647d4f82a4e6baeaa7d94379eafd931e0c16cbc44b4ba4d1e", "sha512-224": "af398c7f21f58e1377580227a89590d3ab8be52b31182fad9ec4d667", "sha512-256": "0ed15b2750a2a7281e96af006ab79e82ed54a7a2081bdb49e70a70d8c6bfeff0", }; diff --git a/test/js/bun/util/which.test.ts b/test/js/bun/util/which.test.ts index d7cbcbcc88..28539b2ed2 100644 --- a/test/js/bun/util/which.test.ts +++ b/test/js/bun/util/which.test.ts @@ -117,7 +117,7 @@ if (isWindows) { test("Bun.which does not look in the current directory for bins", async () => { const cwd = process.cwd(); const dir = tempDirWithFiles("which", { - "some_program_name": "#!/usr/bin/env sh\necho FAIL\nexit 0\n", + some_program_name: "#!/usr/bin/env sh\necho FAIL\nexit 0\n", "some_program_name.cmd": "@echo FAIL\n@exit 0\n", }); process.chdir(dir); @@ -136,7 +136,7 @@ test("Bun.which does not look in the current directory for bins", async () => { test("Bun.which does look in the current directory when given a path with a slash", async () => { const cwd = process.cwd(); const dir = tempDirWithFiles("which", { - "some_program_name": "#!/usr/bin/env sh\necho posix\nexit 0\n", + some_program_name: "#!/usr/bin/env sh\necho posix\nexit 0\n", "some_program_name.cmd": "@echo win32\n@exit 0\n", "folder/other_app": "#!/usr/bin/env sh\necho posix\nexit 0\n", "folder/other_app.cmd": "@echo win32\n@exit 0\n", @@ -164,7 +164,7 @@ test("Bun.which does look in the current directory when given a path with a slas test("Bun.which can find executables in a non-ascii directory", async () => { const cwd = process.cwd(); const dir = tempDirWithFiles("which-non-ascii-ๅผ€ๅง‹ๅญฆไน ", { - "some_program_name": "#!/usr/bin/env sh\necho posix\nexit 0\n", + some_program_name: "#!/usr/bin/env sh\necho posix\nexit 0\n", "some_program_name.cmd": "@echo win32\n@exit 0\n", }); diff --git a/test/js/bun/util/zstd.test.ts b/test/js/bun/util/zstd.test.ts index ce963ef833..6a7f7b67aa 100644 --- a/test/js/bun/util/zstd.test.ts +++ b/test/js/bun/util/zstd.test.ts @@ -46,33 +46,33 @@ describe("Zstandard compression", async () => { original: Buffer.from( JSON.stringify( { - "private": true, - "name": "bun", - "version": "1.2.14", - "workspaces": ["./packages/bun-types", "./packages/@types/bun"], - "devDependencies": { + private: true, + name: "bun", + version: "1.2.14", + workspaces: ["./packages/bun-types", "./packages/@types/bun"], + devDependencies: { "@types/react": "^18.3.3", - "esbuild": "^0.21.4", - "mitata": "^0.1.11", - "peechy": "0.4.34", - "prettier": "^3.5.3", + esbuild: "^0.21.4", + mitata: "^0.1.11", + peechy: "0.4.34", + prettier: "^3.5.3", "prettier-plugin-organize-imports": "^4.0.0", - "react": "^18.3.1", + react: "^18.3.1", "react-dom": "^18.3.1", "source-map-js": "^1.2.0", - "typescript": "^5.7.2", + typescript: "^5.7.2", }, - "resolutions": { + resolutions: { "bun-types": "workspace:packages/bun-types", "@types/bun": "workspace:packages/@types/bun", }, - "scripts": { - "build": "bun run build:debug", - "watch": + scripts: { + build: "bun run build:debug", + watch: "zig build check --watch -fincremental --prominent-compile-errors --global-cache-dir build/debug/zig-check-cache --zig-lib-dir vendor/zig/lib", "watch-windows": "zig build check-windows --watch -fincremental --prominent-compile-errors --global-cache-dir build/debug/zig-check-cache --zig-lib-dir vendor/zig/lib", - "agent": + agent: "(bun run --silent build:debug &> /tmp/bun.debug.build.log || (cat /tmp/bun.debug.build.log && rm -rf /tmp/bun.debug.build.log && exit 1)) && rm -f /tmp/bun.debug.build.log && ./build/debug/bun-debug", "build:debug": "bun ./scripts/build.mjs -GNinja -DCMAKE_BUILD_TYPE=Debug -B build/debug", "build:debug:asan": @@ -103,18 +103,18 @@ describe("Zstandard compression", async () => { 'docker run --rm -v "$PWD:/root/bun/" -w /root/bun ghcr.io/oven-sh/bun-development-docker-image', "css-properties": "bun run src/css/properties/generate_properties.ts", "uv-posix-stubs": "bun run src/bun.js/bindings/libuv/generate_uv_posix_stubs.ts", - "bump": "bun ./scripts/bump.ts", - "typecheck": "tsc --noEmit && cd test && bun run typecheck", - "fmt": "bun run prettier", + bump: "bun ./scripts/bump.ts", + typecheck: "tsc --noEmit && cd test && bun run typecheck", + fmt: "bun run prettier", "fmt:cpp": "bun run clang-format", "fmt:zig": "bun run zig-format", - "lint": "bunx oxlint --config=oxlint.json --format=github src/js", + lint: "bunx oxlint --config=oxlint.json --format=github src/js", "lint:fix": "oxlint --config oxlint.json --fix", - "test": "node scripts/runner.node.mjs --exec-path ./build/debug/bun-debug", + test: "node scripts/runner.node.mjs --exec-path ./build/debug/bun-debug", "test:release": "node scripts/runner.node.mjs --exec-path ./build/release/bun", - "banned": "bun test test/internal/ban-words.test.ts", + banned: "bun test test/internal/ban-words.test.ts", "glob-sources": "bun scripts/glob-sources.mjs", - "zig": "vendor/zig/zig.exe", + zig: "vendor/zig/zig.exe", "zig:test": "bun ./scripts/build.mjs -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUN_TEST=ON -B build/debug", "zig:test:release": "bun ./scripts/build.mjs -GNinja -DCMAKE_BUILD_TYPE=Release -DBUNTEST=ON -B build/release", @@ -124,7 +124,7 @@ describe("Zstandard compression", async () => { "zig:check": "bun run zig build check --summary new", "zig:check-all": "bun run zig build check-all --summary new", "zig:check-windows": "bun run zig build check-windows --summary new", - "analysis": + analysis: "bun ./scripts/build.mjs -DCMAKE_BUILD_TYPE=Debug -DENABLE_ANALYSIS=ON -DENABLE_CCACHE=OFF -B build/analysis", "analysis:no-llvm": "bun run analysis -DENABLE_LLVM=OFF", "clang-format": "bun run analysis --target clang-format", @@ -135,7 +135,7 @@ describe("Zstandard compression", async () => { "clang-tidy:diff": "bun run analysis --target clang-tidy-diff", "zig-format": "bun run analysis:no-llvm --target zig-format", "zig-format:check": "bun run analysis:no-llvm --target zig-format-check", - "prettier": + prettier: "bunx prettier@latest --plugin=prettier-plugin-organize-imports --config .prettierrc --write scripts packages src docs 'test/**/*.{test,spec}.{ts,tsx,js,jsx,mts,mjs,cjs,cts}' '!test/**/*fixture*.*'", "node:test": "node ./scripts/runner.node.mjs --quiet --exec-path=$npm_execpath --node-tests ", "clean:zig": diff --git a/test/js/bun/websocket/websocket-server.test.ts b/test/js/bun/websocket/websocket-server.test.ts index 23022030c2..4d9c3055d3 100644 --- a/test/js/bun/websocket/websocket-server.test.ts +++ b/test/js/bun/websocket/websocket-server.test.ts @@ -813,7 +813,7 @@ async function connect(server: Server): Promise { const client = spawn({ cmd: [bunExe(), pathname, url.href], cwd: import.meta.dir, - env: { ...bunEnv, "LOG_MESSAGES": "0" }, + env: { ...bunEnv, LOG_MESSAGES: "0" }, stdio: ["inherit", "inherit", "inherit"], ipc(message) { if (message === "connected") { diff --git a/test/js/node/child_process/child_process.test.ts b/test/js/node/child_process/child_process.test.ts index 79a9e76c94..3f1946de1d 100644 --- a/test/js/node/child_process/child_process.test.ts +++ b/test/js/node/child_process/child_process.test.ts @@ -400,15 +400,15 @@ it("it accepts stdio passthrough", async () => { await fs.promises.writeFile( path.join(package_dir, "package.json"), JSON.stringify({ - "name": "npm-run-all-test", - "version": "1.0.0", - "type": "module", - "scripts": { - "all": "run-p echo-hello echo-world", + name: "npm-run-all-test", + version: "1.0.0", + type: "module", + scripts: { + all: "run-p echo-hello echo-world", "echo-hello": "echo hello", "echo-world": "echo world", }, - "devDependencies": { + devDependencies: { "npm-run-all": "4.1.5", }, }), diff --git a/test/js/node/crypto/node-crypto.test.js b/test/js/node/crypto/node-crypto.test.js index 689b16d711..a95db5f744 100644 --- a/test/js/node/crypto/node-crypto.test.js +++ b/test/js/node/crypto/node-crypto.test.js @@ -38,219 +38,219 @@ it("crypto.randomInt with a callback", async () => { describe("createHash", () => { const nodeValues = { "RSA-MD5": { - "value": "b10a8db164e0754105b7a99be72e3fe5", - "input": "Hello World", + value: "b10a8db164e0754105b7a99be72e3fe5", + input: "Hello World", }, "RSA-RIPEMD160": { - "value": "a830d7beb04eb7549ce990fb7dc962e499a27230", - "input": "Hello World", + value: "a830d7beb04eb7549ce990fb7dc962e499a27230", + input: "Hello World", }, "RSA-SHA1": { - "value": "0a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + value: "0a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, "RSA-SHA1-2": { - "value": "0a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + value: "0a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, "RSA-SHA224": { - "value": "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", - "input": "Hello World", + value: "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", + input: "Hello World", }, "RSA-SHA256": { - "value": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", - "input": "Hello World", + value: "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", + input: "Hello World", }, "RSA-SHA3-224": { - "value": "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", - "input": "Hello World", + value: "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", + input: "Hello World", }, "RSA-SHA3-256": { - "value": "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", - "input": "Hello World", + value: "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", + input: "Hello World", }, "RSA-SHA3-384": { - "value": "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", - "input": "Hello World", + value: "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", + input: "Hello World", }, "RSA-SHA3-512": { - "value": + value: "3d58a719c6866b0214f96b0a67b37e51a91e233ce0be126a08f35fdf4c043c6126f40139bfbc338d44eb2a03de9f7bb8eff0ac260b3629811e389a5fbee8a894", - "input": "Hello World", + input: "Hello World", }, "RSA-SHA384": { - "value": "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", - "input": "Hello World", + value: "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", + input: "Hello World", }, "RSA-SHA512": { - "value": + value: "2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b", - "input": "Hello World", + input: "Hello World", }, "RSA-SHA512/224": { - "value": "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", - "input": "Hello World", + value: "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", + input: "Hello World", }, "RSA-SHA512/256": { - "value": "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", - "input": "Hello World", + value: "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", + input: "Hello World", }, "RSA-SM3": { - "value": "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", - "input": "Hello World", + value: "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", + input: "Hello World", }, - "blake2b512": { - "value": + blake2b512: { + value: "4386a08a265111c9896f56456e2cb61a64239115c4784cf438e36cc851221972da3fb0115f73cd02486254001f878ab1fd126aac69844ef1c1ca152379d0a9bd", - "input": "Hello World", + input: "Hello World", }, - "blake2s256": { - "value": "7706af019148849e516f95ba630307a2018bb7bf03803eca5ed7ed2c3c013513", - "input": "Hello World", + blake2s256: { + value: "7706af019148849e516f95ba630307a2018bb7bf03803eca5ed7ed2c3c013513", + input: "Hello World", }, "id-rsassa-pkcs1-v1_5-with-sha3-224": { - "value": "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", - "input": "Hello World", + value: "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", + input: "Hello World", }, "id-rsassa-pkcs1-v1_5-with-sha3-256": { - "value": "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", - "input": "Hello World", + value: "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", + input: "Hello World", }, "id-rsassa-pkcs1-v1_5-with-sha3-384": { - "value": "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", - "input": "Hello World", + value: "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", + input: "Hello World", }, "id-rsassa-pkcs1-v1_5-with-sha3-512": { - "value": + value: "3d58a719c6866b0214f96b0a67b37e51a91e233ce0be126a08f35fdf4c043c6126f40139bfbc338d44eb2a03de9f7bb8eff0ac260b3629811e389a5fbee8a894", - "input": "Hello World", + input: "Hello World", }, - "md5": { - "value": "b10a8db164e0754105b7a99be72e3fe5", - "input": "Hello World", + md5: { + value: "b10a8db164e0754105b7a99be72e3fe5", + input: "Hello World", }, "md5-sha1": { - "value": "b10a8db164e0754105b7a99be72e3fe50a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + value: "b10a8db164e0754105b7a99be72e3fe50a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, - "md5WithRSAEncryption": { - "value": "b10a8db164e0754105b7a99be72e3fe5", - "input": "Hello World", + md5WithRSAEncryption: { + value: "b10a8db164e0754105b7a99be72e3fe5", + input: "Hello World", }, - "ripemd": { - "value": "a830d7beb04eb7549ce990fb7dc962e499a27230", - "input": "Hello World", + ripemd: { + value: "a830d7beb04eb7549ce990fb7dc962e499a27230", + input: "Hello World", }, - "ripemd160": { - "value": "a830d7beb04eb7549ce990fb7dc962e499a27230", - "input": "Hello World", + ripemd160: { + value: "a830d7beb04eb7549ce990fb7dc962e499a27230", + input: "Hello World", }, - "ripemd160WithRSA": { - "value": "a830d7beb04eb7549ce990fb7dc962e499a27230", - "input": "Hello World", + ripemd160WithRSA: { + value: "a830d7beb04eb7549ce990fb7dc962e499a27230", + input: "Hello World", }, - "rmd160": { - "value": "a830d7beb04eb7549ce990fb7dc962e499a27230", - "input": "Hello World", + rmd160: { + value: "a830d7beb04eb7549ce990fb7dc962e499a27230", + input: "Hello World", }, - "sha1": { - "value": "0a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + sha1: { + value: "0a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, - "sha1WithRSAEncryption": { - "value": "0a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + sha1WithRSAEncryption: { + value: "0a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, - "sha224": { - "value": "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", - "input": "Hello World", + sha224: { + value: "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", + input: "Hello World", }, - "sha224WithRSAEncryption": { - "value": "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", - "input": "Hello World", + sha224WithRSAEncryption: { + value: "c4890faffdb0105d991a461e668e276685401b02eab1ef4372795047", + input: "Hello World", }, - "sha256": { - "value": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", - "input": "Hello World", + sha256: { + value: "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", + input: "Hello World", }, - "sha256WithRSAEncryption": { - "value": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", - "input": "Hello World", + sha256WithRSAEncryption: { + value: "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e", + input: "Hello World", }, "sha3-224": { - "value": "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", - "input": "Hello World", + value: "8e800079a0b311788bf29353f400eff969b650a3597c91efd9aa5b38", + input: "Hello World", }, "sha3-256": { - "value": "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", - "input": "Hello World", + value: "e167f68d6563d75bb25f3aa49c29ef612d41352dc00606de7cbd630bb2665f51", + input: "Hello World", }, "sha3-384": { - "value": "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", - "input": "Hello World", + value: "a78ec2851e991638ce505d4a44efa606dd4056d3ab274ec6fdbac00cde16478263ef7213bad5a7db7044f58d637afdeb", + input: "Hello World", }, "sha3-512": { - "value": + value: "3d58a719c6866b0214f96b0a67b37e51a91e233ce0be126a08f35fdf4c043c6126f40139bfbc338d44eb2a03de9f7bb8eff0ac260b3629811e389a5fbee8a894", - "input": "Hello World", + input: "Hello World", }, - "sha384": { - "value": "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", - "input": "Hello World", + sha384: { + value: "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", + input: "Hello World", }, - "sha384WithRSAEncryption": { - "value": "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", - "input": "Hello World", + sha384WithRSAEncryption: { + value: "99514329186b2f6ae4a1329e7ee6c610a729636335174ac6b740f9028396fcc803d0e93863a7c3d90f86beee782f4f3f", + input: "Hello World", }, - "sha512": { - "value": + sha512: { + value: "2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b", - "input": "Hello World", + input: "Hello World", }, "sha512-224": { - "value": "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", - "input": "Hello World", + value: "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", + input: "Hello World", }, "sha512-224WithRSAEncryption": { - "value": "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", - "input": "Hello World", + value: "feca41095c80a571ae782f96bcef9ab81bdf0182509a6844f32c4c17", + input: "Hello World", }, "sha512-256": { - "value": "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", - "input": "Hello World", + value: "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", + input: "Hello World", }, "sha512-256WithRSAEncryption": { - "value": "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", - "input": "Hello World", + value: "ff20018851481c25bfc2e5d0c1e1fa57dac2a237a1a96192f99a10da47aa5442", + input: "Hello World", }, - "sha512WithRSAEncryption": { - "value": + sha512WithRSAEncryption: { + value: "2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b", - "input": "Hello World", + input: "Hello World", }, - "shake128": { - "value": "1227c5f882f9c57bf2e3e48d2c87eb20", - "input": "Hello World", + shake128: { + value: "1227c5f882f9c57bf2e3e48d2c87eb20", + input: "Hello World", }, - "shake256": { - "value": "840d1ce81a4327840b54cb1d419907fd1f62359bad33656e058653d2e4172a43", - "input": "Hello World", + shake256: { + value: "840d1ce81a4327840b54cb1d419907fd1f62359bad33656e058653d2e4172a43", + input: "Hello World", }, - "sm3": { - "value": "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", - "input": "Hello World", + sm3: { + value: "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", + input: "Hello World", }, - "sm3WithRSAEncryption": { - "value": "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", - "input": "Hello World", + sm3WithRSAEncryption: { + value: "77015816143ee627f4fa410b6dad2bdb9fcbdf1e061a452a686b8711a484c5d7", + input: "Hello World", }, "ssl3-md5": { - "value": "b10a8db164e0754105b7a99be72e3fe5", - "input": "Hello World", + value: "b10a8db164e0754105b7a99be72e3fe5", + input: "Hello World", }, "ssl3-sha1": { - "value": "0a4d55a8d778e5022fab701977c5d840bbc486d0", - "input": "Hello World", + value: "0a4d55a8d778e5022fab701977c5d840bbc486d0", + input: "Hello World", }, }; diff --git a/test/js/node/fs/cp.test.ts b/test/js/node/fs/cp.test.ts index a36b20af72..58a05b63ba 100644 --- a/test/js/node/fs/cp.test.ts +++ b/test/js/node/fs/cp.test.ts @@ -309,7 +309,7 @@ for (const [name, copy] of impls) { test.if(process.platform === "win32")("should not throw EBUSY when copying the same file on windows", async () => { const basename = tempDirWithFiles("cp", { - "hey": "hi", + hey: "hi", }); await copy(basename + "/hey", basename + "/hey"); diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts index c56483180a..0169d21289 100644 --- a/test/js/node/fs/fs.test.ts +++ b/test/js/node/fs/fs.test.ts @@ -685,184 +685,184 @@ it("promises.readFile", async () => { describe("promises.readFile", async () => { const nodeOutput = [ { - "encoding": "utf8", - "text": "ascii", - "correct": { - "type": "Buffer", - "data": [97, 115, 99, 105, 105], + encoding: "utf8", + text: "ascii", + correct: { + type: "Buffer", + data: [97, 115, 99, 105, 105], }, - "out": "ascii", + out: "ascii", }, { - "encoding": "utf8", - "text": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", - "correct": { - "type": "Buffer", - "data": [ + encoding: "utf8", + text: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + correct: { + type: "Buffer", + data: [ 117, 116, 102, 49, 54, 32, 240, 159, 141, 135, 32, 240, 159, 141, 136, 32, 240, 159, 141, 137, 32, 240, 159, 141, 138, 32, 240, 159, 141, 139, ], }, - "out": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + out: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", }, { - "encoding": "utf8", - "text": "๐Ÿ‘", - "correct": { - "type": "Buffer", - "data": [240, 159, 145, 141], + encoding: "utf8", + text: "๐Ÿ‘", + correct: { + type: "Buffer", + data: [240, 159, 145, 141], }, - "out": "๐Ÿ‘", + out: "๐Ÿ‘", }, { - "encoding": "utf-8", - "text": "ascii", - "correct": { - "type": "Buffer", - "data": [97, 115, 99, 105, 105], + encoding: "utf-8", + text: "ascii", + correct: { + type: "Buffer", + data: [97, 115, 99, 105, 105], }, - "out": "ascii", + out: "ascii", }, { - "encoding": "utf-8", - "text": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", - "correct": { - "type": "Buffer", - "data": [ + encoding: "utf-8", + text: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + correct: { + type: "Buffer", + data: [ 117, 116, 102, 49, 54, 32, 240, 159, 141, 135, 32, 240, 159, 141, 136, 32, 240, 159, 141, 137, 32, 240, 159, 141, 138, 32, 240, 159, 141, 139, ], }, - "out": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + out: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", }, { - "encoding": "utf-8", - "text": "๐Ÿ‘", - "correct": { - "type": "Buffer", - "data": [240, 159, 145, 141], + encoding: "utf-8", + text: "๐Ÿ‘", + correct: { + type: "Buffer", + data: [240, 159, 145, 141], }, - "out": "๐Ÿ‘", + out: "๐Ÿ‘", }, { - "encoding": "utf16le", - "text": "ascii", - "correct": { - "type": "Buffer", - "data": [97, 0, 115, 0, 99, 0, 105, 0, 105, 0], + encoding: "utf16le", + text: "ascii", + correct: { + type: "Buffer", + data: [97, 0, 115, 0, 99, 0, 105, 0, 105, 0], }, - "out": "ascii", + out: "ascii", }, { - "encoding": "utf16le", - "text": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", - "correct": { - "type": "Buffer", - "data": [ + encoding: "utf16le", + text: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + correct: { + type: "Buffer", + data: [ 117, 0, 116, 0, 102, 0, 49, 0, 54, 0, 32, 0, 60, 216, 71, 223, 32, 0, 60, 216, 72, 223, 32, 0, 60, 216, 73, 223, 32, 0, 60, 216, 74, 223, 32, 0, 60, 216, 75, 223, ], }, - "out": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + out: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", }, { - "encoding": "utf16le", - "text": "๐Ÿ‘", - "correct": { - "type": "Buffer", - "data": [61, 216, 77, 220], + encoding: "utf16le", + text: "๐Ÿ‘", + correct: { + type: "Buffer", + data: [61, 216, 77, 220], }, - "out": "๐Ÿ‘", + out: "๐Ÿ‘", }, { - "encoding": "latin1", - "text": "ascii", - "correct": { - "type": "Buffer", - "data": [97, 115, 99, 105, 105], + encoding: "latin1", + text: "ascii", + correct: { + type: "Buffer", + data: [97, 115, 99, 105, 105], }, - "out": "ascii", + out: "ascii", }, { - "encoding": "latin1", - "text": "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", - "correct": { - "type": "Buffer", - "data": [117, 116, 102, 49, 54, 32, 60, 71, 32, 60, 72, 32, 60, 73, 32, 60, 74, 32, 60, 75], + encoding: "latin1", + text: "utf16 ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹", + correct: { + type: "Buffer", + data: [117, 116, 102, 49, 54, 32, 60, 71, 32, 60, 72, 32, 60, 73, 32, 60, 74, 32, 60, 75], }, - "out": "utf16 { expect(() => unlinkSync(path)).toThrow( ( { - "darwin": "operation not permitted", - "linux": "illegal operation on a directory", - "win32": "operation not permitted", + darwin: "operation not permitted", + linux: "illegal operation on a directory", + win32: "operation not permitted", } as any )[process.platform], ); @@ -3536,20 +3536,20 @@ it("fs.statfs should work with bigint", async () => { it("fs.Stat constructor", () => { expect(new Stats()).toMatchObject({ - "atimeMs": undefined, - "birthtimeMs": undefined, - "blksize": undefined, - "blocks": undefined, - "ctimeMs": undefined, - "dev": undefined, - "gid": undefined, - "ino": undefined, - "mode": undefined, - "mtimeMs": undefined, - "nlink": undefined, - "rdev": undefined, - "size": undefined, - "uid": undefined, + atimeMs: undefined, + birthtimeMs: undefined, + blksize: undefined, + blocks: undefined, + ctimeMs: undefined, + dev: undefined, + gid: undefined, + ino: undefined, + mode: undefined, + mtimeMs: undefined, + nlink: undefined, + rdev: undefined, + size: undefined, + uid: undefined, }); }); @@ -3609,7 +3609,7 @@ describe('kernel32 long path conversion does not mangle "../../path" into "path" }); const tmp2 = tempDirWithFiles("longpath", { "a/b/hello": "true", - "config": "true", + config: "true", }); const workingDir1 = path.join(tmp1, "a/b"); const workingDir2 = path.join(tmp2, "a/b"); diff --git a/test/js/node/http/node-fetch.test.js b/test/js/node/http/node-fetch.test.js index 1e748fda6a..843619e239 100644 --- a/test/js/node/http/node-fetch.test.js +++ b/test/js/node/http/node-fetch.test.js @@ -24,13 +24,13 @@ test("node-fetch", () => { }); test("node-fetch Headers.raw()", () => { - const headers = new Headers({ "a": "1" }); + const headers = new Headers({ a: "1" }); headers.append("Set-Cookie", "b=1"); headers.append("Set-Cookie", "c=1"); expect(headers.raw()).toEqual({ "set-cookie": ["b=1", "c=1"], - "a": ["1"], + a: ["1"], }); }); diff --git a/test/js/node/http/node-http-maxHeaderSize.test.ts b/test/js/node/http/node-http-maxHeaderSize.test.ts index 3a77e783bd..519046e56c 100644 --- a/test/js/node/http/node-http-maxHeaderSize.test.ts +++ b/test/js/node/http/node-http-maxHeaderSize.test.ts @@ -21,7 +21,7 @@ test("maxHeaderSize", async () => { { const response = await fetch(`${server.url}/`, { headers: { - "Huge": Buffer.alloc(8 * 1024, "abc").toString(), + Huge: Buffer.alloc(8 * 1024, "abc").toString(), }, }); expect(response.status).toBe(431); @@ -30,7 +30,7 @@ test("maxHeaderSize", async () => { { const response = await fetch(`${server.url}/`, { headers: { - "Huge": Buffer.alloc(15 * 1024, "abc").toString(), + Huge: Buffer.alloc(15 * 1024, "abc").toString(), }, }); expect(response.status).toBe(431); @@ -49,7 +49,7 @@ test("maxHeaderSize", async () => { { const response = await fetch(`${server.url}/`, { headers: { - "Huge": Buffer.alloc(15 * 1024, "abc").toString(), + Huge: Buffer.alloc(15 * 1024, "abc").toString(), }, }); expect(response.status).toBe(200); @@ -58,7 +58,7 @@ test("maxHeaderSize", async () => { { const response = await fetch(`${server.url}/`, { headers: { - "Huge": Buffer.alloc(17 * 1024, "abc").toString(), + Huge: Buffer.alloc(17 * 1024, "abc").toString(), }, }); expect(response.status).toBe(431); diff --git a/test/js/node/http/node-http.test.ts b/test/js/node/http/node-http.test.ts index 50f8146f0f..f671055be4 100644 --- a/test/js/node/http/node-http.test.ts +++ b/test/js/node/http/node-http.test.ts @@ -224,7 +224,7 @@ describe("node:http", () => { res.setHeader("test", "test"); expect(res.getHeaders()).toEqual({ "set-cookie": ["swag=true", "yolo=true"], - "test": "test", + test: "test", }); }); }); @@ -1079,7 +1079,7 @@ describe("node:http", () => { expect(req.url).toStrictEqual("/bun?a=1"); res.writeHead(200, { "Content-Type": "text/plain", - "Connection": "close", + Connection: "close", }); res.write("Bun\n"); res.end(); @@ -1832,7 +1832,7 @@ it("should emit continue event #7480", done => { let receivedContinue = false; const req = https.request( "https://example.com", - { headers: { "accept-encoding": "identity", "expect": "100-continue" } }, + { headers: { "accept-encoding": "identity", expect: "100-continue" } }, res => { let data = ""; res.setEncoding("utf8"); @@ -2259,7 +2259,7 @@ it("should not emit/throw error when writing after socket.end", async () => { const { promise, resolve, reject } = Promise.withResolvers(); const server = http.createServer((req, res) => { - res.writeHead(200, { "Connection": "close" }); + res.writeHead(200, { Connection: "close" }); res.socket.end(); res.on("error", reject); diff --git a/test/js/node/http2/node-http2.test.js b/test/js/node/http2/node-http2.test.js index ccab660fe2..544245062e 100644 --- a/test/js/node/http2/node-http2.test.js +++ b/test/js/node/http2/node-http2.test.js @@ -177,7 +177,7 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) { expect(parsed.headers["test-header"]).toBe("test-value"); }); it("should be able to send a POST request", async () => { - const payload = JSON.stringify({ "hello": "bun" }); + const payload = JSON.stringify({ hello: "bun" }); const result = await doHttp2Request( HTTPS_SERVER, { ":path": "/post", "test-header": "test-value", ":method": "POST" }, @@ -187,11 +187,11 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) { expect(() => (parsed = JSON.parse(result.data))).not.toThrow(); expect(parsed.url).toBe(`${HTTPS_SERVER}/post`); expect(parsed.headers["test-header"]).toBe("test-value"); - expect(parsed.json).toEqual({ "hello": "bun" }); + expect(parsed.json).toEqual({ hello: "bun" }); expect(parsed.data).toEqual(payload); }); it("should be able to send data using end", async () => { - const payload = JSON.stringify({ "hello": "bun" }); + const payload = JSON.stringify({ hello: "bun" }); const { promise, resolve, reject } = Promise.withResolvers(); const client = http2.connect(HTTPS_SERVER, TLS_OPTIONS); client.on("error", reject); @@ -215,7 +215,7 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) { expect(() => (parsed = JSON.parse(result.data))).not.toThrow(); expect(parsed.url).toBe(`${HTTPS_SERVER}/post`); expect(parsed.headers["test-header"]).toBe("test-value"); - expect(parsed.json).toEqual({ "hello": "bun" }); + expect(parsed.json).toEqual({ hello: "bun" }); expect(parsed.data).toEqual(payload); }); it("should be able to mutiplex GET requests", async () => { @@ -260,11 +260,11 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) { }); it("should be able to mutiplex POST requests", async () => { const results = await doMultiplexHttp2Request(HTTPS_SERVER, [ - { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ "request": 1 }) }, - { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ "request": 2 }) }, - { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ "request": 3 }) }, - { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ "request": 4 }) }, - { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ "request": 5 }) }, + { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ request: 1 }) }, + { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ request: 2 }) }, + { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ request: 3 }) }, + { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ request: 4 }) }, + { headers: { ":path": "/post", ":method": "POST" }, payload: JSON.stringify({ request: 5 }) }, ]); expect(results.length).toBe(5); for (let i = 0; i < results.length; i++) { @@ -276,246 +276,246 @@ for (const nodeExecutable of [nodeExe(), bunExe()]) { }); it("constants", () => { expect(http2.constants).toEqual({ - "NGHTTP2_ERR_FRAME_SIZE_ERROR": -522, - "NGHTTP2_SESSION_SERVER": 0, - "NGHTTP2_SESSION_CLIENT": 1, - "NGHTTP2_STREAM_STATE_IDLE": 1, - "NGHTTP2_STREAM_STATE_OPEN": 2, - "NGHTTP2_STREAM_STATE_RESERVED_LOCAL": 3, - "NGHTTP2_STREAM_STATE_RESERVED_REMOTE": 4, - "NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL": 5, - "NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE": 6, - "NGHTTP2_STREAM_STATE_CLOSED": 7, - "NGHTTP2_FLAG_NONE": 0, - "NGHTTP2_FLAG_END_STREAM": 1, - "NGHTTP2_FLAG_END_HEADERS": 4, - "NGHTTP2_FLAG_ACK": 1, - "NGHTTP2_FLAG_PADDED": 8, - "NGHTTP2_FLAG_PRIORITY": 32, - "DEFAULT_SETTINGS_HEADER_TABLE_SIZE": 4096, - "DEFAULT_SETTINGS_ENABLE_PUSH": 1, - "DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS": 4294967295, - "DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE": 65535, - "DEFAULT_SETTINGS_MAX_FRAME_SIZE": 16384, - "DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE": 65535, - "DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL": 0, - "MAX_MAX_FRAME_SIZE": 16777215, - "MIN_MAX_FRAME_SIZE": 16384, - "MAX_INITIAL_WINDOW_SIZE": 2147483647, - "NGHTTP2_SETTINGS_HEADER_TABLE_SIZE": 1, - "NGHTTP2_SETTINGS_ENABLE_PUSH": 2, - "NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS": 3, - "NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE": 4, - "NGHTTP2_SETTINGS_MAX_FRAME_SIZE": 5, - "NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE": 6, - "NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL": 8, - "PADDING_STRATEGY_NONE": 0, - "PADDING_STRATEGY_ALIGNED": 1, - "PADDING_STRATEGY_MAX": 2, - "PADDING_STRATEGY_CALLBACK": 1, - "NGHTTP2_NO_ERROR": 0, - "NGHTTP2_PROTOCOL_ERROR": 1, - "NGHTTP2_INTERNAL_ERROR": 2, - "NGHTTP2_FLOW_CONTROL_ERROR": 3, - "NGHTTP2_SETTINGS_TIMEOUT": 4, - "NGHTTP2_STREAM_CLOSED": 5, - "NGHTTP2_FRAME_SIZE_ERROR": 6, - "NGHTTP2_REFUSED_STREAM": 7, - "NGHTTP2_CANCEL": 8, - "NGHTTP2_COMPRESSION_ERROR": 9, - "NGHTTP2_CONNECT_ERROR": 10, - "NGHTTP2_ENHANCE_YOUR_CALM": 11, - "NGHTTP2_INADEQUATE_SECURITY": 12, - "NGHTTP2_HTTP_1_1_REQUIRED": 13, - "NGHTTP2_DEFAULT_WEIGHT": 16, - "HTTP2_HEADER_STATUS": ":status", - "HTTP2_HEADER_METHOD": ":method", - "HTTP2_HEADER_AUTHORITY": ":authority", - "HTTP2_HEADER_SCHEME": ":scheme", - "HTTP2_HEADER_PATH": ":path", - "HTTP2_HEADER_PROTOCOL": ":protocol", - "HTTP2_HEADER_ACCEPT_ENCODING": "accept-encoding", - "HTTP2_HEADER_ACCEPT_LANGUAGE": "accept-language", - "HTTP2_HEADER_ACCEPT_RANGES": "accept-ranges", - "HTTP2_HEADER_ACCEPT": "accept", - "HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS": "access-control-allow-credentials", - "HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS": "access-control-allow-headers", - "HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS": "access-control-allow-methods", - "HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN": "access-control-allow-origin", - "HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS": "access-control-expose-headers", - "HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS": "access-control-request-headers", - "HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD": "access-control-request-method", - "HTTP2_HEADER_AGE": "age", - "HTTP2_HEADER_AUTHORIZATION": "authorization", - "HTTP2_HEADER_CACHE_CONTROL": "cache-control", - "HTTP2_HEADER_CONNECTION": "connection", - "HTTP2_HEADER_CONTENT_DISPOSITION": "content-disposition", - "HTTP2_HEADER_CONTENT_ENCODING": "content-encoding", - "HTTP2_HEADER_CONTENT_LENGTH": "content-length", - "HTTP2_HEADER_CONTENT_TYPE": "content-type", - "HTTP2_HEADER_COOKIE": "cookie", - "HTTP2_HEADER_DATE": "date", - "HTTP2_HEADER_ETAG": "etag", - "HTTP2_HEADER_FORWARDED": "forwarded", - "HTTP2_HEADER_HOST": "host", - "HTTP2_HEADER_IF_MODIFIED_SINCE": "if-modified-since", - "HTTP2_HEADER_IF_NONE_MATCH": "if-none-match", - "HTTP2_HEADER_IF_RANGE": "if-range", - "HTTP2_HEADER_LAST_MODIFIED": "last-modified", - "HTTP2_HEADER_LINK": "link", - "HTTP2_HEADER_LOCATION": "location", - "HTTP2_HEADER_RANGE": "range", - "HTTP2_HEADER_REFERER": "referer", - "HTTP2_HEADER_SERVER": "server", - "HTTP2_HEADER_SET_COOKIE": "set-cookie", - "HTTP2_HEADER_STRICT_TRANSPORT_SECURITY": "strict-transport-security", - "HTTP2_HEADER_TRANSFER_ENCODING": "transfer-encoding", - "HTTP2_HEADER_TE": "te", - "HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS": "upgrade-insecure-requests", - "HTTP2_HEADER_UPGRADE": "upgrade", - "HTTP2_HEADER_USER_AGENT": "user-agent", - "HTTP2_HEADER_VARY": "vary", - "HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS": "x-content-type-options", - "HTTP2_HEADER_X_FRAME_OPTIONS": "x-frame-options", - "HTTP2_HEADER_KEEP_ALIVE": "keep-alive", - "HTTP2_HEADER_PROXY_CONNECTION": "proxy-connection", - "HTTP2_HEADER_X_XSS_PROTECTION": "x-xss-protection", - "HTTP2_HEADER_ALT_SVC": "alt-svc", - "HTTP2_HEADER_CONTENT_SECURITY_POLICY": "content-security-policy", - "HTTP2_HEADER_EARLY_DATA": "early-data", - "HTTP2_HEADER_EXPECT_CT": "expect-ct", - "HTTP2_HEADER_ORIGIN": "origin", - "HTTP2_HEADER_PURPOSE": "purpose", - "HTTP2_HEADER_TIMING_ALLOW_ORIGIN": "timing-allow-origin", - "HTTP2_HEADER_X_FORWARDED_FOR": "x-forwarded-for", - "HTTP2_HEADER_PRIORITY": "priority", - "HTTP2_HEADER_ACCEPT_CHARSET": "accept-charset", - "HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE": "access-control-max-age", - "HTTP2_HEADER_ALLOW": "allow", - "HTTP2_HEADER_CONTENT_LANGUAGE": "content-language", - "HTTP2_HEADER_CONTENT_LOCATION": "content-location", - "HTTP2_HEADER_CONTENT_MD5": "content-md5", - "HTTP2_HEADER_CONTENT_RANGE": "content-range", - "HTTP2_HEADER_DNT": "dnt", - "HTTP2_HEADER_EXPECT": "expect", - "HTTP2_HEADER_EXPIRES": "expires", - "HTTP2_HEADER_FROM": "from", - "HTTP2_HEADER_IF_MATCH": "if-match", - "HTTP2_HEADER_IF_UNMODIFIED_SINCE": "if-unmodified-since", - "HTTP2_HEADER_MAX_FORWARDS": "max-forwards", - "HTTP2_HEADER_PREFER": "prefer", - "HTTP2_HEADER_PROXY_AUTHENTICATE": "proxy-authenticate", - "HTTP2_HEADER_PROXY_AUTHORIZATION": "proxy-authorization", - "HTTP2_HEADER_REFRESH": "refresh", - "HTTP2_HEADER_RETRY_AFTER": "retry-after", - "HTTP2_HEADER_TRAILER": "trailer", - "HTTP2_HEADER_TK": "tk", - "HTTP2_HEADER_VIA": "via", - "HTTP2_HEADER_WARNING": "warning", - "HTTP2_HEADER_WWW_AUTHENTICATE": "www-authenticate", - "HTTP2_HEADER_HTTP2_SETTINGS": "http2-settings", - "HTTP2_METHOD_ACL": "ACL", - "HTTP2_METHOD_BASELINE_CONTROL": "BASELINE-CONTROL", - "HTTP2_METHOD_BIND": "BIND", - "HTTP2_METHOD_CHECKIN": "CHECKIN", - "HTTP2_METHOD_CHECKOUT": "CHECKOUT", - "HTTP2_METHOD_CONNECT": "CONNECT", - "HTTP2_METHOD_COPY": "COPY", - "HTTP2_METHOD_DELETE": "DELETE", - "HTTP2_METHOD_GET": "GET", - "HTTP2_METHOD_HEAD": "HEAD", - "HTTP2_METHOD_LABEL": "LABEL", - "HTTP2_METHOD_LINK": "LINK", - "HTTP2_METHOD_LOCK": "LOCK", - "HTTP2_METHOD_MERGE": "MERGE", - "HTTP2_METHOD_MKACTIVITY": "MKACTIVITY", - "HTTP2_METHOD_MKCALENDAR": "MKCALENDAR", - "HTTP2_METHOD_MKCOL": "MKCOL", - "HTTP2_METHOD_MKREDIRECTREF": "MKREDIRECTREF", - "HTTP2_METHOD_MKWORKSPACE": "MKWORKSPACE", - "HTTP2_METHOD_MOVE": "MOVE", - "HTTP2_METHOD_OPTIONS": "OPTIONS", - "HTTP2_METHOD_ORDERPATCH": "ORDERPATCH", - "HTTP2_METHOD_PATCH": "PATCH", - "HTTP2_METHOD_POST": "POST", - "HTTP2_METHOD_PRI": "PRI", - "HTTP2_METHOD_PROPFIND": "PROPFIND", - "HTTP2_METHOD_PROPPATCH": "PROPPATCH", - "HTTP2_METHOD_PUT": "PUT", - "HTTP2_METHOD_REBIND": "REBIND", - "HTTP2_METHOD_REPORT": "REPORT", - "HTTP2_METHOD_SEARCH": "SEARCH", - "HTTP2_METHOD_TRACE": "TRACE", - "HTTP2_METHOD_UNBIND": "UNBIND", - "HTTP2_METHOD_UNCHECKOUT": "UNCHECKOUT", - "HTTP2_METHOD_UNLINK": "UNLINK", - "HTTP2_METHOD_UNLOCK": "UNLOCK", - "HTTP2_METHOD_UPDATE": "UPDATE", - "HTTP2_METHOD_UPDATEREDIRECTREF": "UPDATEREDIRECTREF", - "HTTP2_METHOD_VERSION_CONTROL": "VERSION-CONTROL", - "HTTP_STATUS_CONTINUE": 100, - "HTTP_STATUS_SWITCHING_PROTOCOLS": 101, - "HTTP_STATUS_PROCESSING": 102, - "HTTP_STATUS_EARLY_HINTS": 103, - "HTTP_STATUS_OK": 200, - "HTTP_STATUS_CREATED": 201, - "HTTP_STATUS_ACCEPTED": 202, - "HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION": 203, - "HTTP_STATUS_NO_CONTENT": 204, - "HTTP_STATUS_RESET_CONTENT": 205, - "HTTP_STATUS_PARTIAL_CONTENT": 206, - "HTTP_STATUS_MULTI_STATUS": 207, - "HTTP_STATUS_ALREADY_REPORTED": 208, - "HTTP_STATUS_IM_USED": 226, - "HTTP_STATUS_MULTIPLE_CHOICES": 300, - "HTTP_STATUS_MOVED_PERMANENTLY": 301, - "HTTP_STATUS_FOUND": 302, - "HTTP_STATUS_SEE_OTHER": 303, - "HTTP_STATUS_NOT_MODIFIED": 304, - "HTTP_STATUS_USE_PROXY": 305, - "HTTP_STATUS_TEMPORARY_REDIRECT": 307, - "HTTP_STATUS_PERMANENT_REDIRECT": 308, - "HTTP_STATUS_BAD_REQUEST": 400, - "HTTP_STATUS_UNAUTHORIZED": 401, - "HTTP_STATUS_PAYMENT_REQUIRED": 402, - "HTTP_STATUS_FORBIDDEN": 403, - "HTTP_STATUS_NOT_FOUND": 404, - "HTTP_STATUS_METHOD_NOT_ALLOWED": 405, - "HTTP_STATUS_NOT_ACCEPTABLE": 406, - "HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED": 407, - "HTTP_STATUS_REQUEST_TIMEOUT": 408, - "HTTP_STATUS_CONFLICT": 409, - "HTTP_STATUS_GONE": 410, - "HTTP_STATUS_LENGTH_REQUIRED": 411, - "HTTP_STATUS_PRECONDITION_FAILED": 412, - "HTTP_STATUS_PAYLOAD_TOO_LARGE": 413, - "HTTP_STATUS_URI_TOO_LONG": 414, - "HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE": 415, - "HTTP_STATUS_RANGE_NOT_SATISFIABLE": 416, - "HTTP_STATUS_EXPECTATION_FAILED": 417, - "HTTP_STATUS_TEAPOT": 418, - "HTTP_STATUS_MISDIRECTED_REQUEST": 421, - "HTTP_STATUS_UNPROCESSABLE_ENTITY": 422, - "HTTP_STATUS_LOCKED": 423, - "HTTP_STATUS_FAILED_DEPENDENCY": 424, - "HTTP_STATUS_TOO_EARLY": 425, - "HTTP_STATUS_UPGRADE_REQUIRED": 426, - "HTTP_STATUS_PRECONDITION_REQUIRED": 428, - "HTTP_STATUS_TOO_MANY_REQUESTS": 429, - "HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE": 431, - "HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS": 451, - "HTTP_STATUS_INTERNAL_SERVER_ERROR": 500, - "HTTP_STATUS_NOT_IMPLEMENTED": 501, - "HTTP_STATUS_BAD_GATEWAY": 502, - "HTTP_STATUS_SERVICE_UNAVAILABLE": 503, - "HTTP_STATUS_GATEWAY_TIMEOUT": 504, - "HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED": 505, - "HTTP_STATUS_VARIANT_ALSO_NEGOTIATES": 506, - "HTTP_STATUS_INSUFFICIENT_STORAGE": 507, - "HTTP_STATUS_LOOP_DETECTED": 508, - "HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED": 509, - "HTTP_STATUS_NOT_EXTENDED": 510, - "HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED": 511, + NGHTTP2_ERR_FRAME_SIZE_ERROR: -522, + NGHTTP2_SESSION_SERVER: 0, + NGHTTP2_SESSION_CLIENT: 1, + NGHTTP2_STREAM_STATE_IDLE: 1, + NGHTTP2_STREAM_STATE_OPEN: 2, + NGHTTP2_STREAM_STATE_RESERVED_LOCAL: 3, + NGHTTP2_STREAM_STATE_RESERVED_REMOTE: 4, + NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: 5, + NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: 6, + NGHTTP2_STREAM_STATE_CLOSED: 7, + NGHTTP2_FLAG_NONE: 0, + NGHTTP2_FLAG_END_STREAM: 1, + NGHTTP2_FLAG_END_HEADERS: 4, + NGHTTP2_FLAG_ACK: 1, + NGHTTP2_FLAG_PADDED: 8, + NGHTTP2_FLAG_PRIORITY: 32, + DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096, + DEFAULT_SETTINGS_ENABLE_PUSH: 1, + DEFAULT_SETTINGS_MAX_CONCURRENT_STREAMS: 4294967295, + DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535, + DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384, + DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535, + DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0, + MAX_MAX_FRAME_SIZE: 16777215, + MIN_MAX_FRAME_SIZE: 16384, + MAX_INITIAL_WINDOW_SIZE: 2147483647, + NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: 1, + NGHTTP2_SETTINGS_ENABLE_PUSH: 2, + NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3, + NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4, + NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5, + NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6, + NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8, + PADDING_STRATEGY_NONE: 0, + PADDING_STRATEGY_ALIGNED: 1, + PADDING_STRATEGY_MAX: 2, + PADDING_STRATEGY_CALLBACK: 1, + NGHTTP2_NO_ERROR: 0, + NGHTTP2_PROTOCOL_ERROR: 1, + NGHTTP2_INTERNAL_ERROR: 2, + NGHTTP2_FLOW_CONTROL_ERROR: 3, + NGHTTP2_SETTINGS_TIMEOUT: 4, + NGHTTP2_STREAM_CLOSED: 5, + NGHTTP2_FRAME_SIZE_ERROR: 6, + NGHTTP2_REFUSED_STREAM: 7, + NGHTTP2_CANCEL: 8, + NGHTTP2_COMPRESSION_ERROR: 9, + NGHTTP2_CONNECT_ERROR: 10, + NGHTTP2_ENHANCE_YOUR_CALM: 11, + NGHTTP2_INADEQUATE_SECURITY: 12, + NGHTTP2_HTTP_1_1_REQUIRED: 13, + NGHTTP2_DEFAULT_WEIGHT: 16, + HTTP2_HEADER_STATUS: ":status", + HTTP2_HEADER_METHOD: ":method", + HTTP2_HEADER_AUTHORITY: ":authority", + HTTP2_HEADER_SCHEME: ":scheme", + HTTP2_HEADER_PATH: ":path", + HTTP2_HEADER_PROTOCOL: ":protocol", + HTTP2_HEADER_ACCEPT_ENCODING: "accept-encoding", + HTTP2_HEADER_ACCEPT_LANGUAGE: "accept-language", + HTTP2_HEADER_ACCEPT_RANGES: "accept-ranges", + HTTP2_HEADER_ACCEPT: "accept", + HTTP2_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS: "access-control-allow-credentials", + HTTP2_HEADER_ACCESS_CONTROL_ALLOW_HEADERS: "access-control-allow-headers", + HTTP2_HEADER_ACCESS_CONTROL_ALLOW_METHODS: "access-control-allow-methods", + HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: "access-control-allow-origin", + HTTP2_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS: "access-control-expose-headers", + HTTP2_HEADER_ACCESS_CONTROL_REQUEST_HEADERS: "access-control-request-headers", + HTTP2_HEADER_ACCESS_CONTROL_REQUEST_METHOD: "access-control-request-method", + HTTP2_HEADER_AGE: "age", + HTTP2_HEADER_AUTHORIZATION: "authorization", + HTTP2_HEADER_CACHE_CONTROL: "cache-control", + HTTP2_HEADER_CONNECTION: "connection", + HTTP2_HEADER_CONTENT_DISPOSITION: "content-disposition", + HTTP2_HEADER_CONTENT_ENCODING: "content-encoding", + HTTP2_HEADER_CONTENT_LENGTH: "content-length", + HTTP2_HEADER_CONTENT_TYPE: "content-type", + HTTP2_HEADER_COOKIE: "cookie", + HTTP2_HEADER_DATE: "date", + HTTP2_HEADER_ETAG: "etag", + HTTP2_HEADER_FORWARDED: "forwarded", + HTTP2_HEADER_HOST: "host", + HTTP2_HEADER_IF_MODIFIED_SINCE: "if-modified-since", + HTTP2_HEADER_IF_NONE_MATCH: "if-none-match", + HTTP2_HEADER_IF_RANGE: "if-range", + HTTP2_HEADER_LAST_MODIFIED: "last-modified", + HTTP2_HEADER_LINK: "link", + HTTP2_HEADER_LOCATION: "location", + HTTP2_HEADER_RANGE: "range", + HTTP2_HEADER_REFERER: "referer", + HTTP2_HEADER_SERVER: "server", + HTTP2_HEADER_SET_COOKIE: "set-cookie", + HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: "strict-transport-security", + HTTP2_HEADER_TRANSFER_ENCODING: "transfer-encoding", + HTTP2_HEADER_TE: "te", + HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS: "upgrade-insecure-requests", + HTTP2_HEADER_UPGRADE: "upgrade", + HTTP2_HEADER_USER_AGENT: "user-agent", + HTTP2_HEADER_VARY: "vary", + HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS: "x-content-type-options", + HTTP2_HEADER_X_FRAME_OPTIONS: "x-frame-options", + HTTP2_HEADER_KEEP_ALIVE: "keep-alive", + HTTP2_HEADER_PROXY_CONNECTION: "proxy-connection", + HTTP2_HEADER_X_XSS_PROTECTION: "x-xss-protection", + HTTP2_HEADER_ALT_SVC: "alt-svc", + HTTP2_HEADER_CONTENT_SECURITY_POLICY: "content-security-policy", + HTTP2_HEADER_EARLY_DATA: "early-data", + HTTP2_HEADER_EXPECT_CT: "expect-ct", + HTTP2_HEADER_ORIGIN: "origin", + HTTP2_HEADER_PURPOSE: "purpose", + HTTP2_HEADER_TIMING_ALLOW_ORIGIN: "timing-allow-origin", + HTTP2_HEADER_X_FORWARDED_FOR: "x-forwarded-for", + HTTP2_HEADER_PRIORITY: "priority", + HTTP2_HEADER_ACCEPT_CHARSET: "accept-charset", + HTTP2_HEADER_ACCESS_CONTROL_MAX_AGE: "access-control-max-age", + HTTP2_HEADER_ALLOW: "allow", + HTTP2_HEADER_CONTENT_LANGUAGE: "content-language", + HTTP2_HEADER_CONTENT_LOCATION: "content-location", + HTTP2_HEADER_CONTENT_MD5: "content-md5", + HTTP2_HEADER_CONTENT_RANGE: "content-range", + HTTP2_HEADER_DNT: "dnt", + HTTP2_HEADER_EXPECT: "expect", + HTTP2_HEADER_EXPIRES: "expires", + HTTP2_HEADER_FROM: "from", + HTTP2_HEADER_IF_MATCH: "if-match", + HTTP2_HEADER_IF_UNMODIFIED_SINCE: "if-unmodified-since", + HTTP2_HEADER_MAX_FORWARDS: "max-forwards", + HTTP2_HEADER_PREFER: "prefer", + HTTP2_HEADER_PROXY_AUTHENTICATE: "proxy-authenticate", + HTTP2_HEADER_PROXY_AUTHORIZATION: "proxy-authorization", + HTTP2_HEADER_REFRESH: "refresh", + HTTP2_HEADER_RETRY_AFTER: "retry-after", + HTTP2_HEADER_TRAILER: "trailer", + HTTP2_HEADER_TK: "tk", + HTTP2_HEADER_VIA: "via", + HTTP2_HEADER_WARNING: "warning", + HTTP2_HEADER_WWW_AUTHENTICATE: "www-authenticate", + HTTP2_HEADER_HTTP2_SETTINGS: "http2-settings", + HTTP2_METHOD_ACL: "ACL", + HTTP2_METHOD_BASELINE_CONTROL: "BASELINE-CONTROL", + HTTP2_METHOD_BIND: "BIND", + HTTP2_METHOD_CHECKIN: "CHECKIN", + HTTP2_METHOD_CHECKOUT: "CHECKOUT", + HTTP2_METHOD_CONNECT: "CONNECT", + HTTP2_METHOD_COPY: "COPY", + HTTP2_METHOD_DELETE: "DELETE", + HTTP2_METHOD_GET: "GET", + HTTP2_METHOD_HEAD: "HEAD", + HTTP2_METHOD_LABEL: "LABEL", + HTTP2_METHOD_LINK: "LINK", + HTTP2_METHOD_LOCK: "LOCK", + HTTP2_METHOD_MERGE: "MERGE", + HTTP2_METHOD_MKACTIVITY: "MKACTIVITY", + HTTP2_METHOD_MKCALENDAR: "MKCALENDAR", + HTTP2_METHOD_MKCOL: "MKCOL", + HTTP2_METHOD_MKREDIRECTREF: "MKREDIRECTREF", + HTTP2_METHOD_MKWORKSPACE: "MKWORKSPACE", + HTTP2_METHOD_MOVE: "MOVE", + HTTP2_METHOD_OPTIONS: "OPTIONS", + HTTP2_METHOD_ORDERPATCH: "ORDERPATCH", + HTTP2_METHOD_PATCH: "PATCH", + HTTP2_METHOD_POST: "POST", + HTTP2_METHOD_PRI: "PRI", + HTTP2_METHOD_PROPFIND: "PROPFIND", + HTTP2_METHOD_PROPPATCH: "PROPPATCH", + HTTP2_METHOD_PUT: "PUT", + HTTP2_METHOD_REBIND: "REBIND", + HTTP2_METHOD_REPORT: "REPORT", + HTTP2_METHOD_SEARCH: "SEARCH", + HTTP2_METHOD_TRACE: "TRACE", + HTTP2_METHOD_UNBIND: "UNBIND", + HTTP2_METHOD_UNCHECKOUT: "UNCHECKOUT", + HTTP2_METHOD_UNLINK: "UNLINK", + HTTP2_METHOD_UNLOCK: "UNLOCK", + HTTP2_METHOD_UPDATE: "UPDATE", + HTTP2_METHOD_UPDATEREDIRECTREF: "UPDATEREDIRECTREF", + HTTP2_METHOD_VERSION_CONTROL: "VERSION-CONTROL", + HTTP_STATUS_CONTINUE: 100, + HTTP_STATUS_SWITCHING_PROTOCOLS: 101, + HTTP_STATUS_PROCESSING: 102, + HTTP_STATUS_EARLY_HINTS: 103, + HTTP_STATUS_OK: 200, + HTTP_STATUS_CREATED: 201, + HTTP_STATUS_ACCEPTED: 202, + HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: 203, + HTTP_STATUS_NO_CONTENT: 204, + HTTP_STATUS_RESET_CONTENT: 205, + HTTP_STATUS_PARTIAL_CONTENT: 206, + HTTP_STATUS_MULTI_STATUS: 207, + HTTP_STATUS_ALREADY_REPORTED: 208, + HTTP_STATUS_IM_USED: 226, + HTTP_STATUS_MULTIPLE_CHOICES: 300, + HTTP_STATUS_MOVED_PERMANENTLY: 301, + HTTP_STATUS_FOUND: 302, + HTTP_STATUS_SEE_OTHER: 303, + HTTP_STATUS_NOT_MODIFIED: 304, + HTTP_STATUS_USE_PROXY: 305, + HTTP_STATUS_TEMPORARY_REDIRECT: 307, + HTTP_STATUS_PERMANENT_REDIRECT: 308, + HTTP_STATUS_BAD_REQUEST: 400, + HTTP_STATUS_UNAUTHORIZED: 401, + HTTP_STATUS_PAYMENT_REQUIRED: 402, + HTTP_STATUS_FORBIDDEN: 403, + HTTP_STATUS_NOT_FOUND: 404, + HTTP_STATUS_METHOD_NOT_ALLOWED: 405, + HTTP_STATUS_NOT_ACCEPTABLE: 406, + HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: 407, + HTTP_STATUS_REQUEST_TIMEOUT: 408, + HTTP_STATUS_CONFLICT: 409, + HTTP_STATUS_GONE: 410, + HTTP_STATUS_LENGTH_REQUIRED: 411, + HTTP_STATUS_PRECONDITION_FAILED: 412, + HTTP_STATUS_PAYLOAD_TOO_LARGE: 413, + HTTP_STATUS_URI_TOO_LONG: 414, + HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415, + HTTP_STATUS_RANGE_NOT_SATISFIABLE: 416, + HTTP_STATUS_EXPECTATION_FAILED: 417, + HTTP_STATUS_TEAPOT: 418, + HTTP_STATUS_MISDIRECTED_REQUEST: 421, + HTTP_STATUS_UNPROCESSABLE_ENTITY: 422, + HTTP_STATUS_LOCKED: 423, + HTTP_STATUS_FAILED_DEPENDENCY: 424, + HTTP_STATUS_TOO_EARLY: 425, + HTTP_STATUS_UPGRADE_REQUIRED: 426, + HTTP_STATUS_PRECONDITION_REQUIRED: 428, + HTTP_STATUS_TOO_MANY_REQUESTS: 429, + HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: 431, + HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: 451, + HTTP_STATUS_INTERNAL_SERVER_ERROR: 500, + HTTP_STATUS_NOT_IMPLEMENTED: 501, + HTTP_STATUS_BAD_GATEWAY: 502, + HTTP_STATUS_SERVICE_UNAVAILABLE: 503, + HTTP_STATUS_GATEWAY_TIMEOUT: 504, + HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: 505, + HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: 506, + HTTP_STATUS_INSUFFICIENT_STORAGE: 507, + HTTP_STATUS_LOOP_DETECTED: 508, + HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509, + HTTP_STATUS_NOT_EXTENDED: 510, + HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511, }); }); it("getDefaultSettings", () => { diff --git a/test/js/node/process/process-nexttick.test.js b/test/js/node/process/process-nexttick.test.js index 992d5e9f3f..546c303187 100644 --- a/test/js/node/process/process-nexttick.test.js +++ b/test/js/node/process/process-nexttick.test.js @@ -160,7 +160,7 @@ it("process.nextTick runs after queueMicrotask", async () => { order, runs, }).toEqual({ - "order": [ + order: [ "process.nextTick 0", "process.nextTick 1", "process.nextTick 2", @@ -562,7 +562,7 @@ it("process.nextTick runs after queueMicrotask", async () => { "queueMicrotask 198", "queueMicrotask 199", ], - "runs": [ + runs: [ "nextTick", "nextTick", "nextTick", diff --git a/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js b/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js index cf5f3eccaa..5b4689877f 100644 --- a/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js +++ b/test/js/node/util/node-inspect-tests/parallel/util-inspect.test.js @@ -105,17 +105,14 @@ test("no assertion failures", () => { assert.strictEqual(util.inspect({ a: async () => {} }), "{ a: [AsyncFunction: a] }"); assert.strictEqual(util.inspect({ a: function* () {} }), "{ a: [GeneratorFunction: a] }"); assert.strictEqual(util.inspect({ a: 1, b: 2 }), "{ a: 1, b: 2 }"); - assert.strictEqual(util.inspect({ "a": {} }), "{ a: {} }"); - assert.strictEqual(util.inspect({ "a": { "b": 2 } }), "{ a: { b: 2 } }"); - assert.strictEqual(util.inspect({ "a": { "b": { "c": { "d": 2 } } } }), "{ a: { b: { c: [Object] } } }"); - assert.strictEqual( - util.inspect({ "a": { "b": { "c": { "d": 2 } } } }, false, null), - "{\n a: { b: { c: { d: 2 } } }\n}", - ); + assert.strictEqual(util.inspect({ a: {} }), "{ a: {} }"); + assert.strictEqual(util.inspect({ a: { b: 2 } }), "{ a: { b: 2 } }"); + assert.strictEqual(util.inspect({ a: { b: { c: { d: 2 } } } }), "{ a: { b: { c: [Object] } } }"); + assert.strictEqual(util.inspect({ a: { b: { c: { d: 2 } } } }, false, null), "{\n a: { b: { c: { d: 2 } } }\n}"); assert.strictEqual(util.inspect([1, 2, 3], true), "[ 1, 2, 3, [length]: 3 ]"); - assert.strictEqual(util.inspect({ "a": { "b": { "c": 2 } } }, false, 0), "{ a: [Object] }"); - assert.strictEqual(util.inspect({ "a": { "b": { "c": 2 } } }, false, 1), "{ a: { b: [Object] } }"); - assert.strictEqual(util.inspect({ "a": { "b": ["c"] } }, false, 1), "{ a: { b: [Array] } }"); + assert.strictEqual(util.inspect({ a: { b: { c: 2 } } }, false, 0), "{ a: [Object] }"); + assert.strictEqual(util.inspect({ a: { b: { c: 2 } } }, false, 1), "{ a: { b: [Object] } }"); + assert.strictEqual(util.inspect({ a: { b: ["c"] } }, false, 1), "{ a: { b: [Array] } }"); assert.strictEqual(util.inspect(new Uint8Array(0)), "Uint8Array(0) []"); assert(inspect(new Uint8Array(0), { showHidden: true }).includes("[buffer]")); assert.strictEqual( diff --git a/test/js/node/util/parse_args/parse-args.test.mjs b/test/js/node/util/parse_args/parse-args.test.mjs index b2626c87ed..cadc45a3d9 100644 --- a/test/js/node/util/parse_args/parse-args.test.mjs +++ b/test/js/node/util/parse_args/parse-args.test.mjs @@ -224,7 +224,7 @@ describe("parseArgs", () => { const args = ["---triple"]; const options = {}; const expected = { - values: { "__proto__": null, "-triple": true }, + values: { __proto__: null, "-triple": true }, positionals: [], }; const result = parseArgs({ strict: false, args, options }); @@ -1007,7 +1007,7 @@ describe("parseArgs extra tests", () => { expect(result.values).toEqual({ [U1]: true, [U2]: true, - "bรบn": true, + bรบn: true, }); }); diff --git a/test/js/sql/sql.test.ts b/test/js/sql/sql.test.ts index d8475b0164..ccc2457084 100644 --- a/test/js/sql/sql.test.ts +++ b/test/js/sql/sql.test.ts @@ -5808,7 +5808,7 @@ CREATE TABLE ${table_name} ( test("json[] - single value", async () => { await using sql = postgres({ ...options, max: 1 }); const result = await sql`SELECT ARRAY['{"key": "value"}']::json[] as single_value`; - expect(result[0].single_value).toEqual([{ "key": "value" }]); + expect(result[0].single_value).toEqual([{ key: "value" }]); }); test("json[] - multiple values", async () => { @@ -5820,7 +5820,7 @@ CREATE TABLE ${table_name} ( '{"c": 3}' ]::json[] as multiple_values `; - expect(result[0].multiple_values).toEqual([{ "a": 1 }, { "b": 2 }, { "c": 3 }]); + expect(result[0].multiple_values).toEqual([{ a: 1 }, { b: 2 }, { c: 3 }]); }); test("json[] - null values", async () => { @@ -5833,7 +5833,7 @@ CREATE TABLE ${table_name} ( NULL ]::json[] as array_with_nulls `; - expect(result[0].array_with_nulls).toEqual([{ "a": 1 }, null, { "c": 3 }, null]); + expect(result[0].array_with_nulls).toEqual([{ a: 1 }, null, { c: 3 }, null]); }); test("json[] - null array", async () => { @@ -5890,10 +5890,7 @@ CREATE TABLE ${table_name} ( '{"array": [1, 2, {"key": "value"}]}'::json ]::json[] as nested_json `; - expect(result[0].nested_json).toEqual([ - { "outer": { "inner": "value" } }, - { "array": [1, 2, { "key": "value" }] }, - ]); + expect(result[0].nested_json).toEqual([{ outer: { inner: "value" } }, { array: [1, 2, { key: "value" }] }]); }); test("json[] - array element access", async () => { @@ -5905,9 +5902,9 @@ CREATE TABLE ${table_name} ( (ARRAY['{"a": 1}', '{"b": 2}', '{"c": 3}']::json[])[3] as third_element `; - expect(result[0].first_element).toEqual({ "a": 1 }); - expect(result[0].second_element).toEqual({ "b": 2 }); - expect(result[0].third_element).toEqual({ "c": 3 }); + expect(result[0].first_element).toEqual({ a: 1 }); + expect(result[0].second_element).toEqual({ b: 2 }); + expect(result[0].third_element).toEqual({ c: 3 }); }); test("json[] - array concatenation", async () => { @@ -5918,7 +5915,7 @@ CREATE TABLE ${table_name} ( ARRAY['{"c": 3}', '{"d": 4}']::json[] as concatenated `; - expect(result[0].concatenated).toEqual([{ "a": 1 }, { "b": 2 }, { "c": 3 }, { "d": 4 }]); + expect(result[0].concatenated).toEqual([{ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 }]); }); test("json[] - special characters in JSON", async () => { @@ -5931,11 +5928,7 @@ CREATE TABLE ${table_name} ( ]::json[] as special_chars `; - expect(result[0].special_chars).toEqual([ - { "special\nline": "value" }, - { 'quo"te': "value" }, - { "unicodeA": "A" }, - ]); + expect(result[0].special_chars).toEqual([{ "special\nline": "value" }, { 'quo"te': "value" }, { unicodeA: "A" }]); }); test("json[] - large JSON objects", async () => { @@ -10401,7 +10394,7 @@ CREATE TABLE ${table_name} ( test("jsonb[] - single value", async () => { await using sql = postgres({ ...options, max: 1 }); const result = await sql`SELECT ARRAY['{"key": "value"}']::jsonb[] as single_value`; - expect(result[0].single_value).toEqual([{ "key": "value" }]); + expect(result[0].single_value).toEqual([{ key: "value" }]); }); test("jsonb[] - multiple values", async () => { @@ -10413,7 +10406,7 @@ CREATE TABLE ${table_name} ( '{"c": 3}' ]::jsonb[] as multiple_values `; - expect(result[0].multiple_values).toEqual([{ "a": 1 }, { "b": 2 }, { "c": 3 }]); + expect(result[0].multiple_values).toEqual([{ a: 1 }, { b: 2 }, { c: 3 }]); }); test("jsonb[] - null values", async () => { @@ -10426,7 +10419,7 @@ CREATE TABLE ${table_name} ( NULL ]::jsonb[] as array_with_nulls `; - expect(result[0].array_with_nulls).toEqual([{ "a": 1 }, null, { "c": 3 }, null]); + expect(result[0].array_with_nulls).toEqual([{ a: 1 }, null, { c: 3 }, null]); }); test("jsonb[] - null array", async () => { @@ -10447,7 +10440,7 @@ CREATE TABLE ${table_name} ( '[1, 2, 3]'::jsonb -- array ]::jsonb[] as json_types `; - expect(result[0].json_types).toEqual([null, true, 123, "string", { "key": "value" }, [1, 2, 3]]); + expect(result[0].json_types).toEqual([null, true, 123, "string", { key: "value" }, [1, 2, 3]]); }); test("jsonb[] - nested structures", async () => { @@ -10460,9 +10453,9 @@ CREATE TABLE ${table_name} ( ]::jsonb[] as nested_structures `; expect(result[0].nested_structures).toEqual([ - { "outer": { "inner": "value" } }, - { "array": [1, { "nested": "object" }, [1, 2, 3]] }, - { "mixed": { "array": [1, 2], "object": { "key": "value" } } }, + { outer: { inner: "value" } }, + { array: [1, { nested: "object" }, [1, 2, 3]] }, + { mixed: { array: [1, 2], object: { key: "value" } } }, ]); }); @@ -10488,7 +10481,7 @@ CREATE TABLE ${table_name} ( ]::jsonb[] as whitespace_variants `; // JSONB normalizes whitespace - expect(result[0].whitespace_variants).toEqual([{ "key": "value" }, { "key": "value" }, { "key": "value" }]); + expect(result[0].whitespace_variants).toEqual([{ key: "value" }, { key: "value" }, { key: "value" }]); }); test("jsonb[] - array operators", async () => { @@ -10528,8 +10521,8 @@ CREATE TABLE ${table_name} ( (ARRAY['{"a": 1}', '{"b": 2}']::jsonb[])[2] as second_element `; - expect(result[0].first_element).toEqual({ "a": 1 }); - expect(result[0].second_element).toEqual({ "b": 2 }); + expect(result[0].first_element).toEqual({ a: 1 }); + expect(result[0].second_element).toEqual({ b: 2 }); }); test("jsonb[] - array contains operator", async () => { @@ -10574,7 +10567,7 @@ CREATE TABLE ${table_name} ( ARRAY['{"c": 3}']::jsonb[] as concatenated `; - expect(result[0].concatenated).toEqual([{ "a": 1 }, { "b": 2 }, { "c": 3 }]); + expect(result[0].concatenated).toEqual([{ a: 1 }, { b: 2 }, { c: 3 }]); }); test("jsonb[] - array dimensions", async () => { @@ -10606,11 +10599,11 @@ CREATE TABLE ${table_name} ( `; expect(result[0].unicode_strings).toEqual([ - { "text": "Hello ไธ–็•Œ" }, - { "text": "ะŸั€ะธะฒะตั‚ ะผะธั€" }, - { "text": "์•ˆ๋…•ํ•˜์„ธ์š”" }, - { "text": "ู…ุฑุญุจุง ุจุงู„ุนุงู„ู…" }, - { "text": "๐Ÿ‘‹ ๐ŸŒ ๐Ÿ˜Š" }, + { text: "Hello ไธ–็•Œ" }, + { text: "ะŸั€ะธะฒะตั‚ ะผะธั€" }, + { text: "์•ˆ๋…•ํ•˜์„ธ์š”" }, + { text: "ู…ุฑุญุจุง ุจุงู„ุนุงู„ู…" }, + { text: "๐Ÿ‘‹ ๐ŸŒ ๐Ÿ˜Š" }, ]); }); @@ -10626,10 +10619,10 @@ CREATE TABLE ${table_name} ( `; expect(result[0].escaped_unicode).toEqual([ - { "text": "ABC" }, - { "text": "ยฉยฎโ„ข" }, - { "text": "Hello" }, - { "text": "๐Ÿ‘‹" }, + { text: "ABC" }, + { text: "ยฉยฎโ„ข" }, + { text: "Hello" }, + { text: "๐Ÿ‘‹" }, ]); }); @@ -10644,9 +10637,9 @@ CREATE TABLE ${table_name} ( `; expect(result[0].mixed_unicode).toEqual([ - { "helloไธ–็•Œ": "ไฝ ๅฅฝไธ–็•Œ" }, - { "text": "Hello ไธ–็•Œ" }, - { "ABC": "ใ‚จใƒผใƒ“ใƒผใ‚ทใƒผ" }, + { helloไธ–็•Œ: "ไฝ ๅฅฝไธ–็•Œ" }, + { text: "Hello ไธ–็•Œ" }, + { ABC: "ใ‚จใƒผใƒ“ใƒผใ‚ทใƒผ" }, ]); }); @@ -10661,9 +10654,9 @@ CREATE TABLE ${table_name} ( `; expect(result[0].nested_unicode).toEqual([ - { "outer": { "ไธ–็•Œ": { "ๅ†…้ƒจ": "value" } } }, - { "array": ["ไฝ ๅฅฝ", { "ํ‚ค": "๊ฐ’" }, ["เธชเธงเธฑเธชเธ”เธต"]] }, - { "mixed": { "้…ๅˆ—": ["ใ“ใ‚“ใซใกใฏ", "์•ˆ๋…•"], "ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆ": { "ํ‚ค": "๊ฐ’" } } }, + { outer: { ไธ–็•Œ: { ๅ†…้ƒจ: "value" } } }, + { array: ["ไฝ ๅฅฝ", { ํ‚ค: "๊ฐ’" }, ["เธชเธงเธฑเธชเธ”เธต"]] }, + { mixed: { ้…ๅˆ—: ["ใ“ใ‚“ใซใกใฏ", "์•ˆ๋…•"], ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆ: { ํ‚ค: "๊ฐ’" } } }, ]); }); diff --git a/test/js/third_party/@duckdb/node-api/duckdb.test.ts b/test/js/third_party/@duckdb/node-api/duckdb.test.ts index 4fb3c1e012..d806d4db08 100644 --- a/test/js/third_party/@duckdb/node-api/duckdb.test.ts +++ b/test/js/third_party/@duckdb/node-api/duckdb.test.ts @@ -684,23 +684,23 @@ describe("api", () => { null, ]); assertValues(chunk, 41, DuckDBStructVector, [ - structValue({ "a": null, "b": null }), - structValue({ "a": 42, "b": "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), + structValue({ a: null, b: null }), + structValue({ a: 42, b: "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), null, ]); // struct_of_arrays assertValues(chunk, 42, DuckDBStructVector, [ - structValue({ "a": null, "b": null }), + structValue({ a: null, b: null }), structValue({ - "a": listValue([42, 999, null, null, -42]), - "b": listValue(["๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†", "goose", null, ""]), + a: listValue([42, 999, null, null, -42]), + b: listValue(["๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†", "goose", null, ""]), }), null, ]); // array_of_structs assertValues(chunk, 43, DuckDBListVector, [ listValue([]), - listValue([structValue({ "a": null, "b": null }), structValue({ "a": 42, "b": "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), null]), + listValue([structValue({ a: null, b: null }), structValue({ a: 42, b: "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), null]), null, ]); assertValues(chunk, 44, DuckDBMapVector, [ @@ -735,26 +735,26 @@ describe("api", () => { // fixed_struct_array assertValues(chunk, 50, DuckDBArrayVector, [ arrayValue([ - structValue({ "a": null, "b": null }), - structValue({ "a": 42, "b": "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), - structValue({ "a": null, "b": null }), + structValue({ a: null, b: null }), + structValue({ a: 42, b: "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), + structValue({ a: null, b: null }), ]), arrayValue([ - structValue({ "a": 42, "b": "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), - structValue({ "a": null, "b": null }), - structValue({ "a": 42, "b": "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), + structValue({ a: 42, b: "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), + structValue({ a: null, b: null }), + structValue({ a: 42, b: "๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†" }), ]), null, ]); // struct_of_fixed_array assertValues(chunk, 51, DuckDBStructVector, [ structValue({ - "a": arrayValue([null, 2, 3]), - "b": arrayValue(["a", null, "c"]), + a: arrayValue([null, 2, 3]), + b: arrayValue(["a", null, "c"]), }), structValue({ - "a": arrayValue([4, 5, 6]), - "b": arrayValue(["d", "e", "f"]), + a: arrayValue([4, 5, 6]), + b: arrayValue(["d", "e", "f"]), }), null, ]); @@ -1026,7 +1026,7 @@ describe("api", () => { assertValues(chunk, 0, DuckDBVarCharVector, ["node-neo-api"]); }); test("overriding duckdb_api", async () => { - const instance = await DuckDBInstance.create(undefined, { "duckdb_api": "custom-duckdb-api" }); + const instance = await DuckDBInstance.create(undefined, { duckdb_api: "custom-duckdb-api" }); const connection = await instance.connect(); const result = await connection.run(`select current_setting('duckdb_api') as duckdb_api`); assertColumns(result, [{ name: "duckdb_api", type: DuckDBVarCharType.instance }]); diff --git a/test/js/third_party/astro/astro-post.test.js b/test/js/third_party/astro/astro-post.test.js index 904fb55398..065481bc8a 100644 --- a/test/js/third_party/astro/astro-post.test.js +++ b/test/js/third_party/astro/astro-post.test.js @@ -74,11 +74,11 @@ describe("astro", async () => { formData.append("name", "John Doe"); formData.append("email", "john.doe@example.com"); const r = await fetch(`${origin}/form-data`, { - "body": formData, - "headers": { - "origin": origin, + body: formData, + headers: { + origin: origin, }, - "method": "POST", + method: "POST", }); expect(r.status).toBe(200); diff --git a/test/js/third_party/body-parser/express-body-parser-test.test.ts b/test/js/third_party/body-parser/express-body-parser-test.test.ts index fac3e6adeb..d86f34babe 100644 --- a/test/js/third_party/body-parser/express-body-parser-test.test.ts +++ b/test/js/third_party/body-parser/express-body-parser-test.test.ts @@ -79,14 +79,14 @@ test("GET with body-parser", async () => { app.use(express.json()); app.get("/", (req, res) => { - expect(req.body).toEqual({ "name": "John Doe", "email": "john.doe@example.com" }); + expect(req.body).toEqual({ name: "John Doe", email: "john.doe@example.com" }); req.res.send("Hello World!"); }); function doGet(hostname, port) { const { promise, resolve, reject } = Promise.withResolvers(); const socket = net.createConnection(port, hostname); - const payload = Buffer.from(JSON.stringify({ "name": "John Doe", "email": "john.doe@example.com" })); + const payload = Buffer.from(JSON.stringify({ name: "John Doe", email: "john.doe@example.com" })); socket.write(`GET / HTTP/1.1\r\n`); socket.write(`Host: ${hostname}\r\n`); socket.write(`Content-Length: ${payload.byteLength}\r\n`); diff --git a/test/js/third_party/grpc-js/test-tonic.test.ts b/test/js/third_party/grpc-js/test-tonic.test.ts index ca390576bc..26ccf1079e 100644 --- a/test/js/third_party/grpc-js/test-tonic.test.ts +++ b/test/js/third_party/grpc-js/test-tonic.test.ts @@ -10,12 +10,12 @@ import unzipper from "unzipper"; const protoVersion = "31.0"; const releases = { - "win32_x86_32": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win32.zip`, - "win32_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win64.zip`, - "linux_x86_32": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_32.zip`, - "linux_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_64.zip`, - "darwin_x86_64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-x86_64.zip`, - "darwin_arm64": `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-aarch_64.zip`, + win32_x86_32: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win32.zip`, + win32_x86_64: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-win64.zip`, + linux_x86_32: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_32.zip`, + linux_x86_64: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-linux-x86_64.zip`, + darwin_x86_64: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-x86_64.zip`, + darwin_arm64: `https://github.com/protocolbuffers/protobuf/releases/download/v${protoVersion}/protoc-${protoVersion}-osx-aarch_64.zip`, }; const platform = process.platform; diff --git a/test/js/third_party/jsonwebtoken/jwt.malicious.test.js b/test/js/third_party/jsonwebtoken/jwt.malicious.test.js index b4727aa572..2923989583 100644 --- a/test/js/third_party/jsonwebtoken/jwt.malicious.test.js +++ b/test/js/third_party/jsonwebtoken/jwt.malicious.test.js @@ -32,7 +32,7 @@ describe("when verifying a malicious token", function () { }); it("should not allow arbitrary execution from malicious Buffers containing objects with overridden toString functions", function () { - const token = jwt.sign({ "foo": "bar" }, "secret"); + const token = jwt.sign({ foo: "bar" }, "secret"); const maliciousBuffer = { toString: () => { throw new Error("Arbitrary Code Execution"); diff --git a/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js b/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js index 5ec5971803..c231d1af3b 100644 --- a/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js +++ b/test/js/third_party/jsonwebtoken/validateAsymmetricKey.test.js @@ -6,8 +6,8 @@ const PS_SUPPORTED = true; const ASYMMETRIC_KEY_DETAILS_SUPPORTED = true; const RSA_PSS_KEY_DETAILS_SUPPORTED = true; const allowedAlgorithmsForKeys = { - "ec": ["ES256", "ES384", "ES512"], - "rsa": ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"], + ec: ["ES256", "ES384", "ES512"], + rsa: ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"], "rsa-pss": ["PS256", "PS384", "PS512"], }; diff --git a/test/js/web/console/console-log.test.ts b/test/js/web/console/console-log.test.ts index 4b0d92824b..a0e04de4fc 100644 --- a/test/js/web/console/console-log.test.ts +++ b/test/js/web/console/console-log.test.ts @@ -61,7 +61,7 @@ it("console.group", async () => { const filepath = join(import.meta.dir, "console-group.fixture.js").replaceAll("\\", "/"); const proc = Bun.spawnSync({ cmd: [bunExe(), filepath], - env: { ...bunEnv, "BUN_JSC_showPrivateScriptsInStackTraces": "0" }, + env: { ...bunEnv, BUN_JSC_showPrivateScriptsInStackTraces: "0" }, stdio: ["inherit", "pipe", "pipe"], }); expect(proc.exitCode).toBe(0); diff --git a/test/js/web/encoding/text-decoder-stream.test.ts b/test/js/web/encoding/text-decoder-stream.test.ts index 0bda7c85f3..d0973a5ca1 100644 --- a/test/js/web/encoding/text-decoder-stream.test.ts +++ b/test/js/web/encoding/text-decoder-stream.test.ts @@ -94,7 +94,7 @@ import { readableStreamFromArray } from "harness"; const labelToName = { "unicode-1-1-utf-8": "utf-8", // "iso-8859-2": "iso-8859-2", - "ascii": "windows-1252", + ascii: "windows-1252", "utf-16": "utf-16le", }; diff --git a/test/js/web/fetch/body.test.ts b/test/js/web/fetch/body.test.ts index a7484db5bc..618a4cae2b 100644 --- a/test/js/web/fetch/body.test.ts +++ b/test/js/web/fetch/body.test.ts @@ -527,7 +527,7 @@ for (const { body, fn } of bodyTypes) { }); describe("bodyUsed", () => { const tests: Record = { - "text": [ + text: [ { body: undefined, bodyUsed: false, @@ -545,13 +545,13 @@ for (const { body, fn } of bodyTypes) { bodyUsed: true, }, ], - "json": [ + json: [ { body: "{}", bodyUsed: true, }, ], - "arrayBuffer": [ + arrayBuffer: [ { body: undefined, bodyUsed: false, @@ -566,7 +566,7 @@ for (const { body, fn } of bodyTypes) { bodyUsed: true, }, ], - "blob": [ + blob: [ { body: undefined, bodyUsed: false, @@ -581,14 +581,14 @@ for (const { body, fn } of bodyTypes) { bodyUsed: true, }, ], - "formData": [ + formData: [ { label: "FormData", body: new FormData(), bodyUsed: true, }, ], - "clone": [ + clone: [ { body: null, bodyUsed: false, diff --git a/test/js/web/fetch/fetch-args.test.ts b/test/js/web/fetch/fetch-args.test.ts index 3f848f0350..282c287271 100644 --- a/test/js/web/fetch/fetch-args.test.ts +++ b/test/js/web/fetch/fetch-args.test.ts @@ -32,13 +32,13 @@ test("fetch(request subclass with headers)", async () => { test("fetch(RequestInit, headers)", async () => { const myRequest = { headers: { - "hello": "world", + hello: "world", }, url: server!.url, }; const { headers } = await fetch(myRequest, { headers: { - "hello": "world2", + hello: "world2", }, }); diff --git a/test/js/web/fetch/fetch-connection-header.test.ts b/test/js/web/fetch/fetch-connection-header.test.ts index 52e3ca8fe5..d9a36b9d01 100644 --- a/test/js/web/fetch/fetch-connection-header.test.ts +++ b/test/js/web/fetch/fetch-connection-header.test.ts @@ -77,10 +77,10 @@ describe("fetch Connection header", () => { it("should handle multiple headers including Connection", async () => { const headers = await captureHeadersFromRequest({ headers: { - "accept": "application/json", + accept: "application/json", "accept-encoding": "gzip, deflate", "accept-language": "en-US", - "connection": "close", + connection: "close", "user-agent": "test-agent", "x-test-header": "test-value", }, diff --git a/test/js/web/fetch/fetch-keepalive.test.ts b/test/js/web/fetch/fetch-keepalive.test.ts index 3cf513c148..6a7b1e39e4 100644 --- a/test/js/web/fetch/fetch-keepalive.test.ts +++ b/test/js/web/fetch/fetch-keepalive.test.ts @@ -27,7 +27,7 @@ test("keepalive", async () => { const res = await fetch(`http://localhost:${server.port}`, { keepalive: false, headers: { - "Connection": "HELLO!", + Connection: "HELLO!", }, }); const headers = await res.json(); diff --git a/test/js/web/fetch/fetch.stream.test.ts b/test/js/web/fetch/fetch.stream.test.ts index 1dc27432fe..b8d84fd19d 100644 --- a/test/js/web/fetch/fetch.stream.test.ts +++ b/test/js/web/fetch/fetch.stream.test.ts @@ -15,7 +15,7 @@ const files = [ ]; const fixtures = { - "fixture": readFileSync(join(import.meta.dir, "fixture.html")), + fixture: readFileSync(join(import.meta.dir, "fixture.html")), "fixture.png": readFileSync(join(import.meta.dir, "fixture.png")), "fixture.png.gz": readFileSync(join(import.meta.dir, "fixture.png.gz")), }; diff --git a/test/js/web/fetch/fetch.test.ts b/test/js/web/fetch/fetch.test.ts index 25ec372fdd..9b4723e0da 100644 --- a/test/js/web/fetch/fetch.test.ts +++ b/test/js/web/fetch/fetch.test.ts @@ -1210,7 +1210,7 @@ describe("Response", () => { expect(response.bodyUsed).toBe(false); const promise = response.json(); expect(response.bodyUsed).toBe(true); - expect(await promise).toEqual({ "hello": "world" }); + expect(await promise).toEqual({ hello: "world" }); expect(response.bodyUsed).toBe(true); expect(async () => { await response.json(); @@ -1644,7 +1644,7 @@ describe("should strip headers", () => { return new Response("hello", { headers: { ...request.headers, - "Location": "/redirected", + Location: "/redirected", }, status: 303, }); @@ -1678,7 +1678,7 @@ describe("should strip headers", () => { return new Response("hello", { headers: { ...request.headers, - "Location": `http://${server2.hostname}:${server2.port}/redirected`, + Location: `http://${server2.hostname}:${server2.port}/redirected`, }, status: 302, }); @@ -1697,7 +1697,7 @@ describe("should strip headers", () => { return new Response("hello", { headers: { ...request.headers, - "Location": `http://${server.hostname}:${server.port}/redirected`, + Location: `http://${server.hostname}:${server.port}/redirected`, }, status: 302, }); @@ -1711,9 +1711,9 @@ describe("should strip headers", () => { const { headers, url, redirected } = await fetch(`http://${server1.hostname}:${server1.port}/redirect`, { method: "GET", headers: { - "Authorization": "yes", + Authorization: "yes", "Proxy-Authorization": "yes", - "Cookie": "yes", + Cookie: "yes", }, }); @@ -1733,7 +1733,7 @@ it("same-origin status code 302 should not strip headers", async () => { return new Response("hello", { headers: { ...request.headers, - "Location": `http://${server.hostname}:${server.port}/redirected`, + Location: `http://${server.hostname}:${server.port}/redirected`, }, status: 302, }); @@ -1748,9 +1748,9 @@ it("same-origin status code 302 should not strip headers", async () => { const { headers, url, redirected } = await fetch(`http://${server.hostname}:${server.port}/redirect`, { method: "GET", headers: { - "Authorization": "yes", + Authorization: "yes", "Proxy-Authorization": "yes", - "Cookie": "yes", + Cookie: "yes", }, }); @@ -1800,7 +1800,7 @@ describe("should handle relative location in the redirect, issue#5635", () => { if (url.pathname == pathname) { return new Response("redirecting", { headers: { - "Location": location, + Location: location, }, status: 302, }); @@ -1998,7 +1998,7 @@ describe("http/1.1 response body length", () => { it("should read json until socket closed", async () => { const response = await fetch(`http://${getHost()}/json`); expect(response.status).toBe(200); - expect(response.json()).resolves.toEqual({ "hello": "World" }); + expect(response.json()).resolves.toEqual({ hello: "World" }); }); it("should disable keep-alive", async () => { diff --git a/test/js/web/fetch/headers.test.ts b/test/js/web/fetch/headers.test.ts index 250a26f4f9..ee20780da2 100644 --- a/test/js/web/fetch/headers.test.ts +++ b/test/js/web/fetch/headers.test.ts @@ -38,15 +38,15 @@ describe("Headers", () => { }); test("can create headers from object with duplicates", () => { const headers = new Headers({ - "accept": "*/*", - "Accept": "text/html", + accept: "*/*", + Accept: "text/html", }); expect(headers.get("accept")).toBe("*/*, text/html"); }); test("can create headers from object with non-strings", () => { // @ts-expect-error const headers = new Headers({ - "age": 60, + age: 60, }); expect(headers.get("age")).toBe("60"); }); @@ -340,7 +340,7 @@ describe("Headers", () => { const headers = new Headers({ "user-agent": "bun", "User-Agent": "bun", - "Age": "60", + Age: "60", }); const keys = Array.from(headers.keys()); expect(keys).toEqual(["age", "user-agent"]); diff --git a/test/js/web/fetch/utf8-bom.test.ts b/test/js/web/fetch/utf8-bom.test.ts index aa01b447e9..9b3bbb0866 100644 --- a/test/js/web/fetch/utf8-bom.test.ts +++ b/test/js/web/fetch/utf8-bom.test.ts @@ -24,7 +24,7 @@ describe("UTF-8 BOM should be ignored", () => { it("in json()", async () => { const blob = new Blob(['\uFEFF{"hello":"World ๐ŸŒŽ"}'], { type: "application/json" }); - expect(await blob.json()).toStrictEqual({ "hello": "World ๐ŸŒŽ" } as any); + expect(await blob.json()).toStrictEqual({ hello: "World ๐ŸŒŽ" } as any); }); it("in formData()", async () => { @@ -41,7 +41,7 @@ describe("UTF-8 BOM should be ignored", () => { it("in json()", async () => { const blob = new Blob(['\uFEFF{"hello":"World"}'], { type: "application/json" }); - expect(await blob.json()).toEqual({ "hello": "World" } as any); + expect(await blob.json()).toEqual({ hello: "World" } as any); }); it("in formData()", async () => { @@ -61,7 +61,7 @@ describe("UTF-8 BOM should be ignored", () => { const response = new Response(Buffer.from('\uFEFF{"hello":"World"}'), { headers: { "content-type": "application/json" }, }); - expect(await response.json()).toEqual({ "hello": "World" } as any); + expect(await response.json()).toEqual({ hello: "World" } as any); }); it("in formData()", async () => { @@ -87,7 +87,7 @@ describe("UTF-8 BOM should be ignored", () => { body: Buffer.from('\uFEFF{"hello":"World"}'), headers: { "content-type": "application/json" }, }); - expect(await request.json()).toEqual({ "hello": "World" } as any); + expect(await request.json()).toEqual({ hello: "World" } as any); }); it("in formData()", async () => { @@ -118,7 +118,7 @@ describe("UTF-8 BOM should be ignored", () => { controller.close(); }, }); - expect(await Bun.readableStreamToJSON(stream)).toEqual({ "hello": "World" } as any); + expect(await Bun.readableStreamToJSON(stream)).toEqual({ hello: "World" } as any); }); it("in ReadableStream.prototype.text()", async () => { @@ -138,7 +138,7 @@ describe("UTF-8 BOM should be ignored", () => { controller.close(); }, }); - expect(await stream.json()).toEqual({ "hello": "World" } as any); + expect(await stream.json()).toEqual({ hello: "World" } as any); }); it("in Bun.readableStreamToFormData()", async () => { diff --git a/test/js/web/html/URLSearchParams.test.ts b/test/js/web/html/URLSearchParams.test.ts index 234d0a42c9..cd5d51e0ba 100644 --- a/test/js/web/html/URLSearchParams.test.ts +++ b/test/js/web/html/URLSearchParams.test.ts @@ -3,81 +3,81 @@ import { describe, expect, it } from "bun:test"; describe("URLSearchParams", () => { it("does not crash when calling .toJSON() on a URLSearchParams object with a large number of properties", () => { const props = { - "id": "1296269", - "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", - "name": "Hello-World", - "full_name": "octocat/Hello-World", - "owner": "[object Object]", - "private": "false", - "html_url": "https://github.com/octocat/Hello-World", - "description": "This your first repo!", - "fork": "false", - "url": "https://api.github.com/repos/octocat/Hello-World", - "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", - "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", - "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", - "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", - "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", - "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", - "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", - "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", - "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", - "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", - "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", - "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", - "events_url": "https://api.github.com/repos/octocat/Hello-World/events", - "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", - "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", - "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", - "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", - "git_url": "git:github.com/octocat/Hello-World.git", - "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", - "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", - "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", - "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", - "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", - "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", - "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", - "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", - "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", - "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", - "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", - "ssh_url": "git@github.com:octocat/Hello-World.git", - "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", - "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", - "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", - "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", - "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", - "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", - "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", - "clone_url": "https://github.com/octocat/Hello-World.git", - "mirror_url": "git:git.example.com/octocat/Hello-World", - "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", - "svn_url": "https://svn.github.com/octocat/Hello-World", - "homepage": "https://github.com", - "language": "null", - "forks_count": "9", - "stargazers_count": "80", - "watchers_count": "80", - "size": "108", - "default_branch": "master", - "open_issues_count": "0", - "is_template": "false", - "topics": "octocat,atom,electron,api", - "has_issues": "true", - "has_projects": "true", - "has_wiki": "true", - "has_pages": "false", - "has_downloads": "true", - "has_discussions": "false", - "archived": "false", - "disabled": "false", - "visibility": "public", - "pushed_at": "2011-01-26T19:06:43Z", - "created_at": "2011-01-26T19:01:12Z", - "updated_at": "2011-01-26T19:14:43Z", - "permissions": "[object Object]", - "security_and_analysis": "[object Object]", + id: "1296269", + node_id: "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", + name: "Hello-World", + full_name: "octocat/Hello-World", + owner: "[object Object]", + private: "false", + html_url: "https://github.com/octocat/Hello-World", + description: "This your first repo!", + fork: "false", + url: "https://api.github.com/repos/octocat/Hello-World", + archive_url: "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", + assignees_url: "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", + blobs_url: "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", + branches_url: "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", + collaborators_url: "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", + comments_url: "https://api.github.com/repos/octocat/Hello-World/comments{/number}", + commits_url: "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", + compare_url: "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", + contents_url: "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", + contributors_url: "https://api.github.com/repos/octocat/Hello-World/contributors", + deployments_url: "https://api.github.com/repos/octocat/Hello-World/deployments", + downloads_url: "https://api.github.com/repos/octocat/Hello-World/downloads", + events_url: "https://api.github.com/repos/octocat/Hello-World/events", + forks_url: "https://api.github.com/repos/octocat/Hello-World/forks", + git_commits_url: "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", + git_refs_url: "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", + git_tags_url: "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", + git_url: "git:github.com/octocat/Hello-World.git", + issue_comment_url: "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", + issue_events_url: "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", + issues_url: "https://api.github.com/repos/octocat/Hello-World/issues{/number}", + keys_url: "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", + labels_url: "https://api.github.com/repos/octocat/Hello-World/labels{/name}", + languages_url: "https://api.github.com/repos/octocat/Hello-World/languages", + merges_url: "https://api.github.com/repos/octocat/Hello-World/merges", + milestones_url: "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", + notifications_url: "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", + pulls_url: "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", + releases_url: "https://api.github.com/repos/octocat/Hello-World/releases{/id}", + ssh_url: "git@github.com:octocat/Hello-World.git", + stargazers_url: "https://api.github.com/repos/octocat/Hello-World/stargazers", + statuses_url: "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", + subscribers_url: "https://api.github.com/repos/octocat/Hello-World/subscribers", + subscription_url: "https://api.github.com/repos/octocat/Hello-World/subscription", + tags_url: "https://api.github.com/repos/octocat/Hello-World/tags", + teams_url: "https://api.github.com/repos/octocat/Hello-World/teams", + trees_url: "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", + clone_url: "https://github.com/octocat/Hello-World.git", + mirror_url: "git:git.example.com/octocat/Hello-World", + hooks_url: "https://api.github.com/repos/octocat/Hello-World/hooks", + svn_url: "https://svn.github.com/octocat/Hello-World", + homepage: "https://github.com", + language: "null", + forks_count: "9", + stargazers_count: "80", + watchers_count: "80", + size: "108", + default_branch: "master", + open_issues_count: "0", + is_template: "false", + topics: "octocat,atom,electron,api", + has_issues: "true", + has_projects: "true", + has_wiki: "true", + has_pages: "false", + has_downloads: "true", + has_discussions: "false", + archived: "false", + disabled: "false", + visibility: "public", + pushed_at: "2011-01-26T19:06:43Z", + created_at: "2011-01-26T19:01:12Z", + updated_at: "2011-01-26T19:14:43Z", + permissions: "[object Object]", + security_and_analysis: "[object Object]", }; var params = new URLSearchParams(); for (const key in props) { diff --git a/test/js/web/request/request.test.ts b/test/js/web/request/request.test.ts index 88a52f6a65..c72a37fe8f 100644 --- a/test/js/web/request/request.test.ts +++ b/test/js/web/request/request.test.ts @@ -3,10 +3,10 @@ import { expect, test } from "bun:test"; test("undefined args don't throw", () => { const request = new Request("https://example.com/", { body: undefined, - "credentials": undefined, - "redirect": undefined, - "method": undefined, - "mode": undefined, + credentials: undefined, + redirect: undefined, + method: undefined, + mode: undefined, }); expect(request.method).toBe("GET"); diff --git a/test/js/web/url/url.test.ts b/test/js/web/url/url.test.ts index 71bca8c413..be06a8be2e 100755 --- a/test/js/web/url/url.test.ts +++ b/test/js/web/url/url.test.ts @@ -190,39 +190,39 @@ describe("url", () => { ( [ { - "url": undefined, - "base": undefined, - "expected": false, + url: undefined, + base: undefined, + expected: false, }, { - "url": "a:b", - "base": undefined, - "expected": true, + url: "a:b", + base: undefined, + expected: true, }, { - "url": undefined, - "base": "a:b", - "expected": false, + url: undefined, + base: "a:b", + expected: false, }, { - "url": "a:/b", - "base": undefined, - "expected": true, + url: "a:/b", + base: undefined, + expected: true, }, { - "url": undefined, - "base": "a:/b", - "expected": true, + url: undefined, + base: "a:/b", + expected: true, }, { - "url": "https://test:test", - "base": undefined, - "expected": false, + url: "https://test:test", + base: undefined, + expected: false, }, { - "url": "a", - "base": "https://b/", - "expected": true, + url: "a", + base: "https://b/", + expected: true, }, ] as const ).forEach(({ url, base, expected }) => { diff --git a/test/napi/napi.test.ts b/test/napi/napi.test.ts index 147086c1d4..80d9e14570 100644 --- a/test/napi/napi.test.ts +++ b/test/napi/napi.test.ts @@ -297,7 +297,7 @@ describe("napi", () => { expect(bunLines).toEqual(expectedLines.sort()); }); it("works with cancelation", async () => { - const output = await checkSameOutput("test_napi_async_work_cancel", [], { "UV_THREADPOOL_SIZE": "2" }); + const output = await checkSameOutput("test_napi_async_work_cancel", [], { UV_THREADPOOL_SIZE: "2" }); expect(output).toContain("success!"); expect(output).not.toContain("failure!"); }); diff --git a/test/napi/uv.test.ts b/test/napi/uv.test.ts index 319d481a0b..fa6184b013 100644 --- a/test/napi/uv.test.ts +++ b/test/napi/uv.test.ts @@ -17,19 +17,19 @@ describe.if(!isWindows)("uv stubs", () => { const files = { "uv_impl.c": await Bun.file(source).text(), "package.json": JSON.stringify({ - "name": "fake-plugin", - "module": "index.ts", - "type": "module", - "devDependencies": { + name: "fake-plugin", + module: "index.ts", + type: "module", + devDependencies: { "@types/bun": "latest", }, - "peerDependencies": { - "typescript": "^5.0.0", + peerDependencies: { + typescript: "^5.0.0", }, - "scripts": { + scripts: { "build:napi": "node-gyp configure && node-gyp build", }, - "dependencies": { + dependencies: { "node-gyp": "10.2.0", }, }), diff --git a/test/napi/uv_stub.test.ts b/test/napi/uv_stub.test.ts index e92e22af75..fd85d4f9da 100644 --- a/test/napi/uv_stub.test.ts +++ b/test/napi/uv_stub.test.ts @@ -18,19 +18,19 @@ describe.if(!isWindows)("uv stubs", () => { "plugin.c": await Bun.file(source).text(), "good_plugin.c": await Bun.file(goodSource).text(), "package.json": JSON.stringify({ - "name": "fake-plugin", - "module": "index.ts", - "type": "module", - "devDependencies": { + name: "fake-plugin", + module: "index.ts", + type: "module", + devDependencies: { "@types/bun": "latest", }, - "peerDependencies": { - "typescript": "^5.0.0", + peerDependencies: { + typescript: "^5.0.0", }, - "scripts": { + scripts: { "build:napi": "node-gyp configure && node-gyp build", }, - "dependencies": { + dependencies: { "node-gyp": "10.2.0", }, }), diff --git a/test/regression/issue/11806.test.ts b/test/regression/issue/11806.test.ts index acab108c6e..4c83eafe0b 100644 --- a/test/regression/issue/11806.test.ts +++ b/test/regression/issue/11806.test.ts @@ -4,18 +4,18 @@ import { bunExe, tempDirWithFiles } from "harness"; test("11806", () => { const dir = tempDirWithFiles("11806", { "package.json": JSON.stringify({ - "name": "project", - "workspaces": ["apps/*"], + name: "project", + workspaces: ["apps/*"], }), - "apps": { - "api": { + apps: { + api: { "package.json": JSON.stringify({ - "name": "api", - "jest": { - "testRegex": ".*\\.spec\\.ts$", + name: "api", + jest: { + testRegex: ".*\\.spec\\.ts$", }, - "devDependencies": { - "typescript": "^5.7.3", + devDependencies: { + typescript: "^5.7.3", }, }), }, diff --git a/test/regression/issue/ctrl-c.test.ts b/test/regression/issue/ctrl-c.test.ts index 1ae62b25e0..a223ecbae4 100644 --- a/test/regression/issue/ctrl-c.test.ts +++ b/test/regression/issue/ctrl-c.test.ts @@ -90,10 +90,10 @@ for (const mode of [ "package.json": JSON.stringify({ name: "ctrlc", scripts: { - "dev": "vite", + dev: "vite", }, devDependencies: { - "vite": "^6.0.1", + vite: "^6.0.1", }, }), }); diff --git a/test/regression/issue/update-interactive-formatting.test.ts b/test/regression/issue/update-interactive-formatting.test.ts index 05bf8d8a82..f82675ca0e 100644 --- a/test/regression/issue/update-interactive-formatting.test.ts +++ b/test/regression/issue/update-interactive-formatting.test.ts @@ -10,15 +10,15 @@ describe("bun update --interactive formatting regression", () => { name: "test-project", version: "1.0.0", dependencies: { - "a": "1.0.0", // Very short package name + a: "1.0.0", // Very short package name }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { - "a": { - "integrity": "sha512-fake", - "version": "1.0.0", + lockfileVersion: 3, + packages: { + a: { + integrity: "sha512-fake", + version: "1.0.0", }, }, }), @@ -62,12 +62,12 @@ describe("bun update --interactive formatting regression", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { - "regular-package": { "integrity": "sha512-fake", "version": "1.0.0" }, - "dev-package": { "integrity": "sha512-fake", "version": "1.0.0" }, - "peer-package": { "integrity": "sha512-fake", "version": "1.0.0" }, - "optional-package": { "integrity": "sha512-fake", "version": "1.0.0" }, + lockfileVersion: 3, + packages: { + "regular-package": { integrity: "sha512-fake", version: "1.0.0" }, + "dev-package": { integrity: "sha512-fake", version: "1.0.0" }, + "peer-package": { integrity: "sha512-fake", version: "1.0.0" }, + "optional-package": { integrity: "sha512-fake", version: "1.0.0" }, }, }), }); @@ -101,11 +101,11 @@ describe("bun update --interactive formatting regression", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { + lockfileVersion: 3, + packages: { [longPackageName]: { - "integrity": "sha512-fake", - "version": "1.0.0", + integrity: "sha512-fake", + version: "1.0.0", }, }, }), @@ -141,11 +141,11 @@ describe("bun update --interactive formatting regression", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { + lockfileVersion: 3, + packages: { "package-with-long-version": { - "integrity": "sha512-fake", - "version": longVersion, + integrity: "sha512-fake", + version: longVersion, }, }, }), @@ -192,12 +192,12 @@ describe("bun update --interactive formatting regression", () => { }, }), "bun.lockb": JSON.stringify({ - "lockfileVersion": 3, - "packages": { - [maxWidthPackage]: { "integrity": "sha512-fake", "version": maxWidthVersion }, - [maxWidthPackage + "-dev"]: { "integrity": "sha512-fake", "version": maxWidthVersion }, - [maxWidthPackage + "-peer"]: { "integrity": "sha512-fake", "version": maxWidthVersion }, - [maxWidthPackage + "-optional"]: { "integrity": "sha512-fake", "version": maxWidthVersion }, + lockfileVersion: 3, + packages: { + [maxWidthPackage]: { integrity: "sha512-fake", version: maxWidthVersion }, + [maxWidthPackage + "-dev"]: { integrity: "sha512-fake", version: maxWidthVersion }, + [maxWidthPackage + "-peer"]: { integrity: "sha512-fake", version: maxWidthVersion }, + [maxWidthPackage + "-optional"]: { integrity: "sha512-fake", version: maxWidthVersion }, }, }), });