From 76df30198c82739018f1d072ff6b826cbbf5705b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 8 Mar 2025 10:33:36 +0000 Subject: [PATCH 1/2] fix(vitest-environment): migrate from unenv -> node-mock-http --- package.json | 2 +- pnpm-lock.yaml | 363 +++---------------------------- src/environments/vitest/index.ts | 65 ++++-- 3 files changed, 87 insertions(+), 343 deletions(-) diff --git a/package.json b/package.json index 3707d7c1a..a8397ec63 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "local-pkg": "^1.1.1", "magic-string": "^0.30.17", "node-fetch-native": "^1.6.5", + "node-mock-http": "^1.0.0", "ofetch": "^1.4.1", "pathe": "^2.0.3", "perfect-debounce": "^1.0.0", @@ -84,7 +85,6 @@ "std-env": "^3.8.1", "tinyexec": "^0.3.2", "ufo": "^1.5.4", - "unenv": "^1.10.0", "unplugin": "^2.2.0", "vite": "^6.2.1", "vitest-environment-nuxt": "^1.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e39ffacf1..aadf961c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,7 +52,7 @@ importers: version: 1.15.1 happy-dom: specifier: ^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - version: 17.1.1 + version: 17.4.0 jsdom: specifier: ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0 version: 26.0.0 @@ -64,7 +64,10 @@ importers: version: 0.30.17 node-fetch-native: specifier: ^1.6.5 - version: 1.6.5 + version: 1.6.6 + node-mock-http: + specifier: ^1.0.0 + version: 1.0.0 ofetch: specifier: ^1.4.1 version: 1.4.1 @@ -89,9 +92,6 @@ importers: ufo: specifier: ^1.5.4 version: 1.5.4 - unenv: - specifier: ^1.10.0 - version: 1.10.0 unplugin: specifier: ^2.2.0 version: 2.2.0 @@ -182,7 +182,7 @@ importers: version: 4.1.2 vitest: specifier: 3.0.8 - version: 3.0.8(@types/debug@4.1.12)(@types/node@22.13.10)(happy-dom@17.1.1)(jiti@2.4.2)(jsdom@26.0.0)(terser@5.24.0)(yaml@2.7.0) + version: 3.0.8(@types/debug@4.1.12)(@types/node@22.13.10)(happy-dom@17.4.0)(jiti@2.4.2)(jsdom@26.0.0)(terser@5.24.0)(yaml@2.7.0) vue-router: specifier: 4.5.0 version: 4.5.0(vue@3.5.13(typescript@5.8.2)) @@ -596,10 +596,6 @@ packages: resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==} engines: {node: '>=6.9.0'} - '@babel/types@7.26.7': - resolution: {integrity: sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==} - engines: {node: '>=6.9.0'} - '@babel/types@7.26.9': resolution: {integrity: sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==} engines: {node: '>=6.9.0'} @@ -1341,10 +1337,6 @@ packages: resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.20.0': - resolution: {integrity: sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.22.0': resolution: {integrity: sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2529,10 +2521,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@8.24.0': - resolution: {integrity: sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.24.1': resolution: {integrity: sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2544,33 +2532,16 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@8.24.0': - resolution: {integrity: sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.24.1': resolution: {integrity: sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.24.0': - resolution: {integrity: sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/typescript-estree@8.24.1': resolution: {integrity: sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.24.0': - resolution: {integrity: sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.24.1': resolution: {integrity: sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2578,10 +2549,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@8.24.0': - resolution: {integrity: sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/visitor-keys@8.24.1': resolution: {integrity: sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3236,10 +3203,6 @@ packages: config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - consola@3.3.3: - resolution: {integrity: sha512-Qil5KwghMzlqd51UXM0b6fyaGHtOC22scxrwrz4A2882LyUMwQjnvaedN1HAeXzphspQ6CpHkzMAWxBTUruDLg==} - engines: {node: ^14.18.0 || >=16.10.0} - consola@3.4.0: resolution: {integrity: sha512-EiPU8G6dQG0GFHNR8ljnZFki/8a+cQwEQ+7wpxdChl02Q8HXlwEZWD5lqAF8vC2sEC3Tehr8hy7vErz88LHyUA==} engines: {node: ^14.18.0 || >=16.10.0} @@ -3291,9 +3254,6 @@ packages: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} - crossws@0.3.1: - resolution: {integrity: sha512-HsZgeVYaG+b5zA+9PbIPGq4+J/CJynJuearykPsXx4V/eMhyQ5EDVg3Ak2FBZtVXCiOLu/U7IiwDHTr9MA+IKw==} - crossws@0.3.4: resolution: {integrity: sha512-uj0O1ETYX1Bh6uSgktfPvwDiPYGQ3aI4qVsaC/LWpkIzGj1nUYm5FK3K+t11oOlpN01lGbprFCH4wBlKdJjVgw==} @@ -3884,9 +3844,6 @@ packages: exponential-backoff@3.1.1: resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} - exsolve@1.0.1: - resolution: {integrity: sha512-Smf0iQtkQVJLaph8r/qS8C8SWfQkaq9Q/dFcD44MLbJj6DNhlWefVuaS21SjfqOsBbjVlKtbCj6L9ekXK6EZUg==} - exsolve@1.0.2: resolution: {integrity: sha512-ZEcIMbthn2zeX4/wD/DLxDUjuCltHXT8Htvm/JFlTkdYgWh2+HGppgwwNUnIVxzxP7yJOPtuBAec0dLx6lVY8w==} @@ -4104,11 +4061,6 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.3.10: - resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true @@ -4167,16 +4119,9 @@ packages: resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - h3@1.13.0: - resolution: {integrity: sha512-vFEAu/yf8UMUcB4s43OaDaigcqpQd14yanmOsn+NcRX3/guSKncyE2rOYhq8RIchgJrPSs/QiIddnTTR1ddiAg==} - h3@1.15.1: resolution: {integrity: sha512-+ORaOBttdUm1E2Uu/obAyCguiI7MbBvsLTndc3gyK3zU+SYLoZXlyCP9Xgy0gikkGufFLTZXCXD6+4BsufnmHA==} - happy-dom@17.1.1: - resolution: {integrity: sha512-OSTkBlmD/6Do7gCd7nZB5iFq1bF9VQg/iFmjHmxvVX2S1UiOpo6sT+aFNnu3XUsB8hCZb9+GZ0G1g1TaMiAggw==} - engines: {node: '>=18.0.0'} - happy-dom@17.4.0: resolution: {integrity: sha512-LN2BIuvdFZ8snmF6LtQB2vYBzRmgCx+uqlFX9JpKVRHQ44NODNnOchB4ZW8404djHhdbQgEHRAkXCZ0zGOyzew==} engines: {node: '>=18.0.0'} @@ -4667,10 +4612,6 @@ packages: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} - jackspeak@2.3.6: - resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} - engines: {node: '>=14'} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -5297,10 +5238,6 @@ packages: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} - minipass@7.0.4: - resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} - engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -5364,9 +5301,6 @@ packages: vue-tsc: optional: true - mlly@1.7.3: - resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} - mlly@1.7.4: resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} @@ -5432,10 +5366,6 @@ packages: resolution: {integrity: sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==} engines: {node: '>=18'} - node-fetch-native@1.6.5: - resolution: {integrity: sha512-WvKUNz1fh7EjX9LzBAWgBQt+5BYbTtvElqkOlUsHZyr6yXlRPqfkXFyBwa7KN7LT0q07Uc+/ferkX0PUE9SiZw==} - deprecated: https://github.com/unjs/node-fetch-native/issues/135 - node-fetch-native@1.6.6: resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==} @@ -5608,9 +5538,6 @@ packages: ohash@2.0.11: resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} - ohash@2.0.5: - resolution: {integrity: sha512-3k3APZwRRPYyohdIDmPTpe5i0AY5lm7gvu/Oip7tZrTaEGfSlKX+7kXUoWLd9sHX0GDRVwVvlW18yEcD7qS1zw==} - on-change@5.0.1: resolution: {integrity: sha512-n7THCP7RkyReRSLkJb8kUWoNsxUIBxTkIp3JKno+sEz6o/9AJ3w3P9fzQkITEkMwyTKJjZciF3v/pVoouxZZMg==} engines: {node: '>=18'} @@ -5688,9 +5615,6 @@ packages: package-manager-detector@0.2.11: resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} - package-manager-detector@0.2.8: - resolution: {integrity: sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA==} - pacote@17.0.7: resolution: {integrity: sha512-sgvnoUMlkv9xHwDUKjKQFXVyUi8dtJGKp3vg6sYy+TxbDic5RjZCHF3ygv0EJgNRZ2GfRONjlKPUfokJ9lDpwQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -5763,10 +5687,6 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.10.1: - resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} - engines: {node: '>=16 || 14 >=14.17'} - path-scurry@1.11.1: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} @@ -5815,18 +5735,9 @@ packages: resolution: {integrity: sha512-/JdrhkpXCU4BSpE3KS6pIPaAzcIQQA7YesGjpJThqoqRvNnXcPGRDs678Qfammi8HCkr9HJUcq07/WfSJJMjhg==} hasBin: true - pkg-types@1.3.0: - resolution: {integrity: sha512-kS7yWjVFCkIw9hqdJBoMxDdzEngmkr5FXeWZZfQ6GoYacjVnsW6l2CcYW/0ThD0vF4LPJgVYnrg4d0uuhwYQbg==} - pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - pkg-types@2.0.0: - resolution: {integrity: sha512-W+831FxieJW1CIAh3JMmHaMhK/SiSeyCqbSWqLjjvbjaPDDY0cRkspIfOx4vLkFNgfxnzSxxGFUiMHMm6QpvYA==} - - pkg-types@2.0.1: - resolution: {integrity: sha512-LdDk/hlFeVBoEZqlkJ2bsxwq5fjKQg7i422zu78IC16CSR2XBe7kYxxBx0mkU8kLX6nh50Zp80lZHveKnsHTpQ==} - pkg-types@2.1.0: resolution: {integrity: sha512-wmJwA+8ihJixSoHKxZJRBQG1oY8Yr9pGLzRmSsNms0iNWyHHAlZCa7mmKiFR10YPZuz/2k169JiS/inOjBCZ2A==} @@ -6793,10 +6704,6 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.11: - resolution: {integrity: sha512-32TmKeeKUahv0Go8WmQgiEp9Y21NuxjwjqiRC1nrUB51YacfSwuB44xgXD+HdIppmMRgjQNPdrHyA6vIybYZ+g==} - engines: {node: '>=12.0.0'} - tinyglobby@0.2.12: resolution: {integrity: sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==} engines: {node: '>=12.0.0'} @@ -7366,9 +7273,6 @@ packages: jsdom: optional: true - vscode-uri@3.0.8: - resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} - vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} @@ -7383,9 +7287,6 @@ packages: typescript: optional: true - vue-component-type-helpers@2.0.6: - resolution: {integrity: sha512-qdGXCtoBrwqk1BT6r2+1Wcvl583ZVkuSZ3or7Y1O2w5AvWtlvvxwjGhmz5DdPJS9xqRdDlgTJ/38ehWnEi0tFA==} - vue-component-type-helpers@2.2.2: resolution: {integrity: sha512-6lLY+n2xz2kCYshl59mL6gy8OUUTmkscmDFMO8i7Lj+QKwgnIFUZmM1i/iTYObtrczZVdw7UakPqDTGwVSGaRg==} @@ -7522,18 +7423,6 @@ packages: utf-8-validate: optional: true - ws@8.18.0: - resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.18.1: resolution: {integrity: sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==} engines: {node: '>=10.0.0'} @@ -7586,11 +7475,6 @@ packages: resolution: {integrity: sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==} engines: {node: ^14.17.0 || >=16.0.0} - yaml@2.6.1: - resolution: {integrity: sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==} - engines: {node: '>= 14'} - hasBin: true - yaml@2.7.0: resolution: {integrity: sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==} engines: {node: '>= 14'} @@ -7669,7 +7553,7 @@ snapshots: '@antfu/install-pkg@1.0.0': dependencies: - package-manager-detector: 0.2.8 + package-manager-detector: 0.2.11 tinyexec: 0.3.2 '@antfu/utils@0.7.10': {} @@ -7716,7 +7600,7 @@ snapshots: '@babel/types': 7.26.9 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 + jsesc: 3.1.0 '@babel/helper-annotate-as-pure@7.25.9': dependencies: @@ -7933,11 +7817,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/types@7.26.7': - dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - '@babel/types@7.26.9': dependencies: '@babel/helper-string-parser': 7.25.9 @@ -8013,7 +7892,7 @@ snapshots: debug: 4.4.0(supports-color@8.1.1) error-stack-parser: 2.1.4 figures: 3.2.0 - glob: 10.3.10 + glob: 10.4.5 has-ansi: 4.0.1 indent-string: 4.0.0 is-installed-globally: 0.4.0 @@ -8034,7 +7913,7 @@ snapshots: tmp: 0.2.3 type-fest: 4.26.1 util-arity: 1.1.0 - yaml: 2.6.1 + yaml: 2.7.0 yup: 1.2.0 '@cucumber/gherkin-streams@5.0.1(@cucumber/gherkin@30.0.4)(@cucumber/message-streams@4.0.1(@cucumber/messages@27.0.2))(@cucumber/messages@27.0.2)': @@ -8451,8 +8330,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.20.0': {} - '@eslint/js@9.22.0': {} '@eslint/object-schema@2.1.6': {} @@ -9100,7 +8977,7 @@ snapshots: dependencies: '@antfu/install-pkg': 1.0.0 '@clack/prompts': 0.10.0 - '@eslint/js': 9.20.0 + '@eslint/js': 9.22.0 '@nuxt/eslint-plugin': 1.1.0(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) '@stylistic/eslint-plugin': 4.0.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) '@typescript-eslint/eslint-plugin': 8.24.1(@typescript-eslint/parser@8.24.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) @@ -9164,13 +9041,13 @@ snapshots: dependencies: '@nuxt/kit': 3.16.0(magicast@0.3.5) citty: 0.1.6 - consola: 3.3.3 + consola: 3.4.0 defu: 6.1.4 magic-regexp: 0.8.0 - mlly: 1.7.3 + mlly: 1.7.4 nuxi: 3.17.2 pathe: 1.1.2 - pkg-types: 1.3.0 + pkg-types: 1.3.1 tsconfck: 3.1.3(typescript@5.8.2) unbuild: 2.0.0(typescript@5.8.2)(vue-tsc@2.2.8(typescript@5.8.2)) transitivePeerDependencies: @@ -9869,7 +9746,7 @@ snapshots: '@stylistic/eslint-plugin@4.0.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)': dependencies: - '@typescript-eslint/utils': 8.24.0(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) + '@typescript-eslint/utils': 8.24.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) eslint: 9.22.0(jiti@2.4.2) eslint-visitor-keys: 4.2.0 espree: 10.3.0 @@ -10054,11 +9931,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.24.0': - dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 - '@typescript-eslint/scope-manager@8.24.1': dependencies: '@typescript-eslint/types': 8.24.1 @@ -10075,24 +9947,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.24.0': {} - '@typescript-eslint/types@8.24.1': {} - '@typescript-eslint/typescript-estree@8.24.0(typescript@5.8.2)': - dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 - debug: 4.4.0 - fast-glob: 3.3.3 - is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.7.1 - ts-api-utils: 2.0.1(typescript@5.8.2) - typescript: 5.8.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/typescript-estree@8.24.1(typescript@5.8.2)': dependencies: '@typescript-eslint/types': 8.24.1 @@ -10107,17 +9963,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.24.0(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)': - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.22.0(jiti@2.4.2)) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.8.2) - eslint: 9.22.0(jiti@2.4.2) - typescript: 5.8.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/utils@8.24.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.22.0(jiti@2.4.2)) @@ -10129,11 +9974,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.24.0': - dependencies: - '@typescript-eslint/types': 8.24.0 - eslint-visitor-keys: 4.2.0 - '@typescript-eslint/visitor-keys@8.24.1': dependencies: '@typescript-eslint/types': 8.24.1 @@ -10231,7 +10071,7 @@ snapshots: dependencies: '@volar/language-core': 2.4.11 path-browserify: 1.0.1 - vscode-uri: 3.0.8 + vscode-uri: 3.1.0 '@voxpelli/semver-set@6.0.0': dependencies: @@ -10374,7 +10214,7 @@ snapshots: '@vue/test-utils@2.4.6': dependencies: js-beautify: 1.14.9 - vue-component-type-helpers: 2.0.6 + vue-component-type-helpers: 2.2.2 '@webcontainer/env@1.1.1': {} @@ -10682,13 +10522,13 @@ snapshots: confbox: 0.1.8 defu: 6.1.4 dotenv: 16.4.7 - exsolve: 1.0.1 + exsolve: 1.0.2 giget: 2.0.0 jiti: 2.4.2 - ohash: 2.0.5 + ohash: 2.0.11 pathe: 2.0.3 perfect-debounce: 1.0.0 - pkg-types: 2.0.0 + pkg-types: 2.1.0 rc9: 2.1.2 optionalDependencies: magicast: 0.3.5 @@ -10908,8 +10748,6 @@ snapshots: ini: 1.3.8 proto-list: 1.2.4 - consola@3.3.3: {} - consola@3.4.0: {} convert-gitmoji@0.1.5: {} @@ -10960,10 +10798,6 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - crossws@0.3.1: - dependencies: - uncrypto: 0.1.3 - crossws@0.3.4: dependencies: uncrypto: 0.1.3 @@ -11483,8 +11317,8 @@ snapshots: eslint-plugin-import-x@4.6.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2): dependencies: '@types/doctrine': 0.0.9 - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/utils': 8.24.0(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/utils': 8.24.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2) debug: 4.4.0 doctrine: 3.0.0 enhanced-resolve: 5.18.0 @@ -11728,8 +11562,6 @@ snapshots: exponential-backoff@3.1.1: {} - exsolve@1.0.1: {} - exsolve@1.0.2: {} extend@3.0.2: {} @@ -11942,14 +11774,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.3.10: - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.3.6 - minimatch: 9.0.4 - minipass: 7.0.4 - path-scurry: 1.10.1 - glob@10.4.5: dependencies: foreground-child: 3.1.1 @@ -12023,19 +11847,6 @@ snapshots: dependencies: duplexer: 0.1.2 - h3@1.13.0: - dependencies: - cookie-es: 1.2.2 - crossws: 0.3.1 - defu: 6.1.4 - destr: 2.0.3 - iron-webcrypto: 1.2.1 - ohash: 1.1.4 - radix3: 1.1.2 - ufo: 1.5.4 - uncrypto: 0.1.3 - unenv: 1.10.0 - h3@1.15.1: dependencies: cookie-es: 1.2.2 @@ -12048,11 +11859,6 @@ snapshots: ufo: 1.5.4 uncrypto: 0.1.3 - happy-dom@17.1.1: - dependencies: - webidl-conversions: 7.0.0 - whatwg-mimetype: 3.0.0 - happy-dom@17.4.0: dependencies: webidl-conversions: 7.0.0 @@ -12613,12 +12419,6 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - jackspeak@2.3.6: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -12874,7 +12674,7 @@ snapshots: '@babel/generator': 7.26.2 '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.0) '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.0) - '@babel/types': 7.26.7 + '@babel/types': 7.26.9 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 @@ -12992,7 +12792,7 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.1.0 - ws: 8.18.0 + ws: 8.18.1 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -13104,14 +12904,14 @@ snapshots: '@parcel/watcher-wasm': 2.4.1 citty: 0.1.6 clipboardy: 4.0.0 - consola: 3.3.3 - crossws: 0.3.1 + consola: 3.4.0 + crossws: 0.3.4 defu: 6.1.4 get-port-please: 3.1.2 - h3: 1.13.0 + h3: 1.15.1 http-shutdown: 1.2.2 jiti: 2.4.2 - mlly: 1.7.3 + mlly: 1.7.4 node-forge: 1.3.1 pathe: 1.1.2 std-env: 3.8.1 @@ -13127,7 +12927,7 @@ snapshots: local-pkg@1.1.1: dependencies: mlly: 1.7.4 - pkg-types: 2.0.1 + pkg-types: 2.1.0 quansync: 0.2.8 locate-path@5.0.0: @@ -13199,7 +12999,7 @@ snapshots: magicast@0.3.5: dependencies: '@babel/parser': 7.26.7 - '@babel/types': 7.26.7 + '@babel/types': 7.26.9 source-map-js: 1.2.1 make-dir@4.0.0: @@ -13628,8 +13428,6 @@ snapshots: minipass@5.0.0: {} - minipass@7.0.4: {} - minipass@7.1.2: {} minizlib@2.1.2: @@ -13689,13 +13487,6 @@ snapshots: vue: 3.5.13(typescript@5.8.2) vue-tsc: 2.2.8(typescript@5.8.2) - mlly@1.7.3: - dependencies: - acorn: 8.14.0 - pathe: 1.1.2 - pkg-types: 1.3.1 - ufo: 1.5.4 - mlly@1.7.4: dependencies: acorn: 8.14.0 @@ -13851,8 +13642,6 @@ snapshots: emojilib: 2.4.0 skin-tone: 2.0.0 - node-fetch-native@1.6.5: {} - node-fetch-native@1.6.6: {} node-fetch@2.7.0(encoding@0.1.13): @@ -14151,15 +13940,13 @@ snapshots: ofetch@1.4.1: dependencies: destr: 2.0.3 - node-fetch-native: 1.6.5 + node-fetch-native: 1.6.6 ufo: 1.5.4 ohash@1.1.4: {} ohash@2.0.11: {} - ohash@2.0.5: {} - on-change@5.0.1: {} on-finished@2.4.1: @@ -14272,8 +14059,6 @@ snapshots: dependencies: quansync: 0.2.8 - package-manager-detector@0.2.8: {} - pacote@17.0.7: dependencies: '@npmcli/git': 5.0.8 @@ -14369,11 +14154,6 @@ snapshots: path-parse@1.0.7: {} - path-scurry@1.10.1: - dependencies: - lru-cache: 10.4.3 - minipass: 7.0.4 - path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 @@ -14411,13 +14191,7 @@ snapshots: isbinaryfile: 5.0.4 pkg-types: 1.3.1 query-registry: 3.0.1 - tinyglobby: 0.2.11 - - pkg-types@1.3.0: - dependencies: - confbox: 0.1.8 - mlly: 1.7.4 - pathe: 1.1.2 + tinyglobby: 0.2.12 pkg-types@1.3.1: dependencies: @@ -14425,17 +14199,6 @@ snapshots: mlly: 1.7.4 pathe: 2.0.3 - pkg-types@2.0.0: - dependencies: - confbox: 0.1.8 - pathe: 2.0.3 - - pkg-types@2.0.1: - dependencies: - confbox: 0.1.8 - exsolve: 1.0.2 - pathe: 2.0.3 - pkg-types@2.1.0: dependencies: confbox: 0.2.1 @@ -15514,11 +15277,6 @@ snapshots: tinyexec@0.3.2: {} - tinyglobby@0.2.11: - dependencies: - fdir: 6.4.3(picomatch@4.0.2) - picomatch: 4.0.2 - tinyglobby@0.2.12: dependencies: fdir: 6.4.3(picomatch@4.0.2) @@ -15701,7 +15459,7 @@ snapshots: mkdist: 2.2.0(typescript@5.8.2)(vue-tsc@2.2.8(typescript@5.8.2))(vue@3.5.13(typescript@5.8.2)) mlly: 1.7.4 pathe: 2.0.3 - pkg-types: 2.0.0 + pkg-types: 2.1.0 pretty-bytes: 6.1.1 rollup: 4.35.0 rollup-plugin-dts: 6.1.1(rollup@4.35.0)(typescript@5.8.2) @@ -15733,7 +15491,7 @@ snapshots: consola: 3.4.0 defu: 6.1.4 mime: 3.0.0 - node-fetch-native: 1.6.5 + node-fetch-native: 1.6.6 pathe: 1.1.2 unenv@2.0.0-rc.12: @@ -15796,7 +15554,7 @@ snapshots: pkg-types: 1.3.1 scule: 1.3.0 strip-literal: 3.0.0 - tinyglobby: 0.2.11 + tinyglobby: 0.2.12 unplugin: 2.2.0 unplugin-utils: 0.2.4 @@ -15933,7 +15691,7 @@ snapshots: dependencies: '@babel/core': 7.26.0 '@babel/standalone': 7.26.4 - '@babel/types': 7.26.7 + '@babel/types': 7.26.9 citty: 0.1.6 defu: 6.1.4 jiti: 2.4.2 @@ -16117,47 +15875,6 @@ snapshots: dependencies: '@nuxt/test-utils': 'link:' - vitest@3.0.8(@types/debug@4.1.12)(@types/node@22.13.10)(happy-dom@17.1.1)(jiti@2.4.2)(jsdom@26.0.0)(terser@5.24.0)(yaml@2.7.0): - dependencies: - '@vitest/expect': 3.0.8 - '@vitest/mocker': 3.0.8(vite@6.2.1(@types/node@22.13.10)(jiti@2.4.2)(terser@5.24.0)(yaml@2.7.0)) - '@vitest/pretty-format': 3.0.8 - '@vitest/runner': 3.0.8 - '@vitest/snapshot': 3.0.8 - '@vitest/spy': 3.0.8 - '@vitest/utils': 3.0.8 - chai: 5.2.0 - debug: 4.4.0 - expect-type: 1.1.0 - magic-string: 0.30.17 - pathe: 2.0.3 - std-env: 3.8.1 - tinybench: 2.9.0 - tinyexec: 0.3.2 - tinypool: 1.0.2 - tinyrainbow: 2.0.0 - vite: 6.2.1(@types/node@22.13.10)(jiti@2.4.2)(terser@5.24.0)(yaml@2.7.0) - vite-node: 3.0.8(@types/node@22.13.10)(jiti@2.4.2)(terser@5.24.0)(yaml@2.7.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/debug': 4.1.12 - '@types/node': 22.13.10 - happy-dom: 17.1.1 - jsdom: 26.0.0 - transitivePeerDependencies: - - jiti - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - vitest@3.0.8(@types/debug@4.1.12)(@types/node@22.13.10)(happy-dom@17.4.0)(jiti@2.4.2)(jsdom@26.0.0)(terser@5.24.0)(yaml@2.7.0): dependencies: '@vitest/expect': 3.0.8 @@ -16199,8 +15916,6 @@ snapshots: - tsx - yaml - vscode-uri@3.0.8: {} - vscode-uri@3.1.0: {} vue-bundle-renderer@2.1.1: @@ -16216,8 +15931,6 @@ snapshots: optionalDependencies: typescript: 5.8.2 - vue-component-type-helpers@2.0.6: {} - vue-component-type-helpers@2.2.2: {} vue-devtools-stub@0.1.0: {} @@ -16363,8 +16076,6 @@ snapshots: ws@8.17.1: {} - ws@8.18.0: {} - ws@8.18.1: {} xml-name-validator@4.0.0: {} @@ -16393,8 +16104,6 @@ snapshots: lodash: 4.17.21 yaml: 2.7.0 - yaml@2.6.1: {} - yaml@2.7.0: {} yargs-parser@21.1.1: {} diff --git a/src/environments/vitest/index.ts b/src/environments/vitest/index.ts index 70bf6c625..c1965e6a4 100644 --- a/src/environments/vitest/index.ts +++ b/src/environments/vitest/index.ts @@ -2,11 +2,11 @@ import type { Environment } from 'vitest/environments' import { createFetch } from 'ofetch' import { indexedDB } from 'fake-indexeddb' import { joinURL } from 'ufo' -import { createApp, defineEventHandler, toNodeListener } from 'h3' +import { createApp, defineEventHandler, toNodeListener, splitCookiesString } from 'h3' import defu from 'defu' import { createRouter as createRadixRouter, exportMatcher, toRouteMatcher } from 'radix3' import { populateGlobal } from 'vitest/environments' -import { createCall, createFetch as createLocalFetch } from 'unenv/runtime/fetch/index' +import { fetchNodeRequestHandler } from 'node-mock-http' import type { NuxtBuiltinEnvironment } from './types' import happyDom from './env/happy-dom' @@ -81,27 +81,26 @@ export default { win.URLSearchParams = globalThis.URLSearchParams } - // @ts-expect-error TODO: fix in h3 - const localCall = createCall(toNodeListener(h3App)) - const localFetch = createLocalFetch(localCall, win.fetch) + const nodeHandler = toNodeListener(h3App) const registry = new Set() - win.fetch = (init, options) => { - if (typeof init === 'string') { - const base = init.split('?')[0] - if (registry.has(base) || registry.has(init)) { - init = '/_' + init + const localFetch: typeof fetch = async (url, init) => { + if (typeof url === 'string') { + const base = url.split('?')[0] + if (registry.has(base) || registry.has(url)) { + url = '/_' + url + } + if (url.startsWith('/')) { + const response = await fetchNodeRequestHandler(nodeHandler, url, init) + return normalizeFetchResponse(response) } } - return localFetch(init.toString(), { - ...options, - headers: Array.isArray(options?.headers) ? new Headers(options?.headers) : options?.headers, - }) + return win.fetch(url, init) } // @ts-expect-error fetch types differ slightly - win.$fetch = createFetch({ fetch: win.fetch, Headers: win.Headers }) + win.$fetch = createFetch({ fetch: localFetch, Headers: win.Headers }) win.__registry = registry win.__app = h3App @@ -158,3 +157,39 @@ export default { } }, } + +/** utils from nitro */ + +function normalizeFetchResponse(response: Response) { + if (!response.headers.has('set-cookie')) { + return response + } + return new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: normalizeCookieHeaders(response.headers), + }) +} + +function normalizeCookieHeader(header: number | string | string[] = '') { + return splitCookiesString(joinHeaders(header)) +} + +function normalizeCookieHeaders(headers: Headers) { + const outgoingHeaders = new Headers() + for (const [name, header] of headers) { + if (name === 'set-cookie') { + for (const cookie of normalizeCookieHeader(header)) { + outgoingHeaders.append('set-cookie', cookie) + } + } + else { + outgoingHeaders.set(name, joinHeaders(header)) + } + } + return outgoingHeaders +} + +function joinHeaders(value: number | string | string[]) { + return Array.isArray(value) ? value.join(', ') : String(value) +} From b9f0d146d047fee8266c6d2ca905df821d64f402 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 8 Mar 2025 10:55:16 +0000 Subject: [PATCH 2/2] fix: set `win.fetch` --- src/environments/vitest/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/environments/vitest/index.ts b/src/environments/vitest/index.ts index c1965e6a4..6a9184c7c 100644 --- a/src/environments/vitest/index.ts +++ b/src/environments/vitest/index.ts @@ -85,7 +85,7 @@ export default { const registry = new Set() - const localFetch: typeof fetch = async (url, init) => { + win.fetch = async (url, init) => { if (typeof url === 'string') { const base = url.split('?')[0] if (registry.has(base) || registry.has(url)) { @@ -96,11 +96,11 @@ export default { return normalizeFetchResponse(response) } } - return win.fetch(url, init) + return fetch(url, init) } // @ts-expect-error fetch types differ slightly - win.$fetch = createFetch({ fetch: localFetch, Headers: win.Headers }) + win.$fetch = createFetch({ fetch: win.fetch, Headers: win.Headers }) win.__registry = registry win.__app = h3App