diff --git a/package-lock.json b/package-lock.json index 4e3951cc..7701e50d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "selfsigned": "^2.4.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "node_modules/@ampproject/remapping": { @@ -13431,6 +13431,7 @@ }, "node_modules/ws": { "version": "8.18.0", + "dev": true, "license": "MIT", "engines": { "node": ">=10.0.0" @@ -13538,7 +13539,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/client": { @@ -13567,7 +13568,7 @@ "saslmechanisms": "^0.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/client-core": { @@ -13583,7 +13584,7 @@ "saslmechanisms": "^0.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/component": { @@ -13597,7 +13598,7 @@ "@xmpp/reconnect": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/component-core": { @@ -13610,7 +13611,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/connection": { @@ -13624,7 +13625,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/connection-tcp": { @@ -13636,7 +13637,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/debug": { @@ -13648,7 +13649,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/error": { @@ -13656,7 +13657,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/events": { @@ -13667,7 +13668,7 @@ "events": "^3.3.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/id": { @@ -13675,7 +13676,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/iq": { @@ -13689,7 +13690,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/jid": { @@ -13697,7 +13698,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/middleware": { @@ -13711,7 +13712,7 @@ "koa-compose": "^4.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/reconnect": { @@ -13722,7 +13723,7 @@ "@xmpp/events": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/resolve": { @@ -13734,7 +13735,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/resource-binding": { @@ -13745,7 +13746,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl": { @@ -13759,7 +13760,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl-anonymous": { @@ -13770,7 +13771,7 @@ "sasl-anonymous": "^0.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl-ht-sha-256-none": { @@ -13778,7 +13779,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl-plain": { @@ -13789,7 +13790,7 @@ "sasl-plain": "^0.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl-scram-sha-1": { @@ -13800,7 +13801,7 @@ "sasl-scram-sha-1": "^1.3.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/sasl2": { @@ -13827,7 +13828,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/starttls": { @@ -13840,7 +13841,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/stream-features": { @@ -13848,7 +13849,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/stream-management": { @@ -13861,7 +13862,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/tcp": { @@ -13872,7 +13873,7 @@ "@xmpp/connection-tcp": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/test": { @@ -13891,7 +13892,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/time": { @@ -13899,7 +13900,7 @@ "version": "0.14.0", "license": "ISC", "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/tls": { @@ -13912,7 +13913,7 @@ "@xmpp/events": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/uri": { @@ -13924,7 +13925,7 @@ "iri": "^1.3.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/websocket": { @@ -13934,11 +13935,10 @@ "dependencies": { "@xmpp/connection": "^0.14.0", "@xmpp/events": "^0.14.0", - "@xmpp/xml": "^0.14.0", - "ws": "^8.18.0" + "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/xml": { @@ -13950,7 +13950,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } }, "packages/xmpp.js": { @@ -13993,7 +13993,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" } } } diff --git a/package.json b/package.json index 524a8ccb..26c130c5 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ "selfsigned": "^2.4.1" }, "scripts": { - "test": "npx jest", - "e2e": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.cjs", + "test": "node --experimental-websocket ./node_modules/.bin/jest", + "e2e": "NODE_TLS_REJECT_UNAUTHORIZED=0 node --experimental-websocket ./node_modules/.bin/jest --runInBand --config e2e.config.cjs", "preversion": "make bundle" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "workspaces": [ "packages/*" diff --git a/packages/base64/package.json b/packages/base64/package.json index 1875ca42..5f77d17e 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -13,7 +13,7 @@ "base64" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/client-core/package.json b/packages/client-core/package.json index c6ed923c..749ddad3 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -16,7 +16,7 @@ "saslmechanisms": "^0.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/client/README.md b/packages/client/README.md index 12eda4b8..2ac26d1f 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -293,10 +293,3 @@ PLAIN should only be used over secure WebSocket (`wss://)`, direct TLS (`xmpps:` - ☐ : Optional - ✗ : Unavailable - ✔ : Included - -## Common issues - -
- Unable to resolve module -

If you are using an older React Native version, please require/import @xmpp/client/reat-native instead of @xmpp/client.

-
diff --git a/packages/client/package.json b/packages/client/package.json index f23b77b7..49bdbdd3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -35,7 +35,7 @@ "@xmpp/sasl-scram-sha-1": false }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/component-core/package.json b/packages/component-core/package.json index adad8b19..c75f5234 100644 --- a/packages/component-core/package.json +++ b/packages/component-core/package.json @@ -19,7 +19,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/component/package.json b/packages/component/package.json index 1e538aa0..919cb3c7 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -19,7 +19,7 @@ "@xmpp/reconnect": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/connection-tcp/package.json b/packages/connection-tcp/package.json index 16bf68f0..893733a2 100644 --- a/packages/connection-tcp/package.json +++ b/packages/connection-tcp/package.json @@ -18,7 +18,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/connection/package.json b/packages/connection/package.json index 8ffff73f..50c7e2c9 100644 --- a/packages/connection/package.json +++ b/packages/connection/package.json @@ -19,7 +19,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/debug/package.json b/packages/debug/package.json index 01342432..3e22f377 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -13,7 +13,7 @@ "debug" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "dependencies": { "@xmpp/xml": "^0.14.0", diff --git a/packages/error/package.json b/packages/error/package.json index 1bf254fe..8d6b6490 100644 --- a/packages/error/package.json +++ b/packages/error/package.json @@ -13,7 +13,7 @@ "error" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/events/package.json b/packages/events/package.json index d8a392b1..d8e1954e 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -15,7 +15,7 @@ "EventEmitter" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/id/package.json b/packages/id/package.json index 196b4656..1a25c3d2 100644 --- a/packages/id/package.json +++ b/packages/id/package.json @@ -13,7 +13,7 @@ "id" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/iq/package.json b/packages/iq/package.json index e8e317e7..516623cf 100644 --- a/packages/iq/package.json +++ b/packages/iq/package.json @@ -15,7 +15,7 @@ "callee" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "dependencies": { "@xmpp/events": "^0.14.0", diff --git a/packages/jid/package.json b/packages/jid/package.json index 8b85bc72..2b495bbf 100644 --- a/packages/jid/package.json +++ b/packages/jid/package.json @@ -13,7 +13,7 @@ "JID" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/middleware/package.json b/packages/middleware/package.json index 30eaa078..ae06012b 100644 --- a/packages/middleware/package.json +++ b/packages/middleware/package.json @@ -19,7 +19,7 @@ "koa-compose": "^4.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/reconnect/package.json b/packages/reconnect/package.json index a6fc4ce8..f6349657 100644 --- a/packages/reconnect/package.json +++ b/packages/reconnect/package.json @@ -16,7 +16,7 @@ "@xmpp/events": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/resolve/package.json b/packages/resolve/package.json index b5ee247b..3d8f9546 100644 --- a/packages/resolve/package.json +++ b/packages/resolve/package.json @@ -26,7 +26,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/resource-binding/package.json b/packages/resource-binding/package.json index d3ac6f8d..464db07b 100644 --- a/packages/resource-binding/package.json +++ b/packages/resource-binding/package.json @@ -17,7 +17,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-anonymous/package.json b/packages/sasl-anonymous/package.json index 00fbc57c..1aae183a 100644 --- a/packages/sasl-anonymous/package.json +++ b/packages/sasl-anonymous/package.json @@ -16,7 +16,7 @@ "sasl-anonymous": "^0.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-ht-sha-256-none/package.json b/packages/sasl-ht-sha-256-none/package.json index 6af011c2..3d4e0d96 100644 --- a/packages/sasl-ht-sha-256-none/package.json +++ b/packages/sasl-ht-sha-256-none/package.json @@ -13,7 +13,7 @@ "sasl" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-plain/package.json b/packages/sasl-plain/package.json index 9b401b8f..d529e0dc 100644 --- a/packages/sasl-plain/package.json +++ b/packages/sasl-plain/package.json @@ -16,7 +16,7 @@ "sasl-plain": "^0.1.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-scram-sha-1/package.json b/packages/sasl-scram-sha-1/package.json index 17ee55c0..ac121e80 100644 --- a/packages/sasl-scram-sha-1/package.json +++ b/packages/sasl-scram-sha-1/package.json @@ -16,7 +16,7 @@ "sasl-scram-sha-1": "^1.3.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/sasl/package.json b/packages/sasl/package.json index 445c5b92..7aeced69 100644 --- a/packages/sasl/package.json +++ b/packages/sasl/package.json @@ -19,7 +19,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/session-establishment/package.json b/packages/session-establishment/package.json index f916982c..f3ef5714 100644 --- a/packages/session-establishment/package.json +++ b/packages/session-establishment/package.json @@ -17,7 +17,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/starttls/package.json b/packages/starttls/package.json index 803b4b60..0359af86 100644 --- a/packages/starttls/package.json +++ b/packages/starttls/package.json @@ -18,7 +18,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/stream-features/package.json b/packages/stream-features/package.json index 29638c20..cc9c5eb2 100644 --- a/packages/stream-features/package.json +++ b/packages/stream-features/package.json @@ -14,7 +14,7 @@ "features" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/stream-management/package.json b/packages/stream-management/package.json index e9818cbb..245bdece 100644 --- a/packages/stream-management/package.json +++ b/packages/stream-management/package.json @@ -19,7 +19,7 @@ "@xmpp/xml": "^0.14.0" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/tcp/package.json b/packages/tcp/package.json index 38fdab15..2ae44a73 100644 --- a/packages/tcp/package.json +++ b/packages/tcp/package.json @@ -16,7 +16,7 @@ "tcp" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/test/package.json b/packages/test/package.json index 99583494..aa63b797 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -13,7 +13,7 @@ "test" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "dependencies": { "@xmpp/client": "^0.14.0", diff --git a/packages/time/package.json b/packages/time/package.json index 88721c6e..97722d54 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -14,7 +14,7 @@ "date" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/tls/package.json b/packages/tls/package.json index d3811246..1b1f8c74 100644 --- a/packages/tls/package.json +++ b/packages/tls/package.json @@ -18,7 +18,7 @@ "tls" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/uri/package.json b/packages/uri/package.json index 77165677..69a0ecda 100644 --- a/packages/uri/package.json +++ b/packages/uri/package.json @@ -17,7 +17,7 @@ "iri": "^1.3.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/websocket/lib/Connection.js b/packages/websocket/lib/Connection.js index 335b7661..f73b0924 100644 --- a/packages/websocket/lib/Connection.js +++ b/packages/websocket/lib/Connection.js @@ -13,16 +13,16 @@ const NS_FRAMING = "urn:ietf:params:xml:ns:xmpp-framing"; class ConnectionWebSocket extends Connection { send(element, ...args) { - if (!element.attrs.xmlns && super.isStanza(element)) { - element.attrs.xmlns = "jabber:client"; - } - + element.attrs.xmlns ??= this.NS; return super.send(element, ...args); } async sendMany(elements) { for (const element of elements) { - await this.send(element); + element.attrs.xmlns ??= this.NS; + element.parent = this.root; + this.socket.write(element.toString()); + this.emit("send", element); } } diff --git a/packages/websocket/lib/Socket.js b/packages/websocket/lib/Socket.js index 1d551bb6..802f196b 100644 --- a/packages/websocket/lib/Socket.js +++ b/packages/websocket/lib/Socket.js @@ -1,10 +1,6 @@ -import WS from "ws"; import { EventEmitter, listeners } from "@xmpp/events"; import { parseURI } from "@xmpp/connection/lib/util.js"; -// eslint-disable-next-line n/no-unsupported-features/node-builtins -const WebSocket = globalThis.WebSocket || WS; - const CODE = "ECONNERROR"; export default class Socket extends EventEmitter { @@ -22,6 +18,7 @@ export default class Socket extends EventEmitter { connect(url) { this.url = url; + // eslint-disable-next-line n/no-unsupported-features/node-builtins this._attachSocket(new WebSocket(url, ["xmpp"])); } @@ -64,16 +61,12 @@ export default class Socket extends EventEmitter { } write(data, fn) { - if (WebSocket === WS) { - this.socket.send(data, fn); - } else { - try { - this.socket.send(data); - } catch (err) { - fn(err); - return; - } - fn(); + try { + this.socket.send(data); + } catch (err) { + fn?.(err); + return; } + fn?.(); } } diff --git a/packages/websocket/package.json b/packages/websocket/package.json index 001afdde..7a5e891f 100644 --- a/packages/websocket/package.json +++ b/packages/websocket/package.json @@ -11,18 +11,14 @@ "dependencies": { "@xmpp/connection": "^0.14.0", "@xmpp/events": "^0.14.0", - "@xmpp/xml": "^0.14.0", - "ws": "^8.18.0" - }, - "browser": { - "ws": false + "@xmpp/xml": "^0.14.0" }, "keywords": [ "XMPP", "websocket" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/websocket/test/test.js b/packages/websocket/test/test.js index 742cd1c4..fda33685 100644 --- a/packages/websocket/test/test.js +++ b/packages/websocket/test/test.js @@ -3,15 +3,18 @@ import Socket from "../lib/Socket.js"; import { EventEmitter } from "@xmpp/events"; import xml from "@xmpp/xml"; -test("send() adds jabber:client xmlns", () => { +test("send()", () => { const connection = new ConnectionWebSocket(); connection.write = () => {}; + connection.root = xml("root"); const element = xml("presence"); expect(element.attrs.xmlns).toBe(undefined); + expect(element.parent).toBe(null); connection.send(element); expect(element.attrs.xmlns).toBe("jabber:client"); + expect(element.parent).toBe(connection.root); }); test("socketParameters()", () => { @@ -27,7 +30,7 @@ test("socketParameters()", () => { expect(params).toBe(undefined); }); -test("DOM WebSocket error", () => { +test("WebSocket error", () => { const socket = new Socket(); const sock = new EventEmitter(); sock.addEventListener = sock.addListener; @@ -44,22 +47,6 @@ test("DOM WebSocket error", () => { socket.socket.emit("error", evt); }); -test("WS WebSocket error", () => { - const socket = new Socket(); - const sock = new EventEmitter(); - sock.addEventListener = sock.addListener; - socket._attachSocket(sock); - socket.url = "ws://foobar"; - const error = {}; - const evt = { error }; - socket.on("error", (err) => { - expect(err).toBe(error); - expect(err.event).toBe(evt); - expect(err.url).toBe("ws://foobar"); - }); - socket.socket.emit("error", evt); -}); - test("socket close", () => { expect.assertions(3); const socket = new Socket(); @@ -81,15 +68,27 @@ test("socket close", () => { test("sendMany", async () => { const conn = new ConnectionWebSocket(); + conn.socket = new Socket(); + const spy_write = jest.spyOn(conn.socket, "write"); + conn.root = xml("root"); + + const foo = xml("presence"); + const bar = xml("presence"); + const elements = [foo, bar]; - const foo = xml("foo"); - const bar = xml("bar"); + for (const element of elements) { + expect(element.attrs.xmlns).toBe(undefined); + expect(element.parent).toBe(null); + } - const spy_send = (conn.send = jest.fn()); + conn.sendMany(elements); - await conn.sendMany([foo, bar]); + for (const element of elements) { + expect(element.attrs.xmlns).toBe("jabber:client"); + expect(element.parent).toBe(conn.root); + } - expect(spy_send).toHaveBeenCalledWith(foo); - expect(spy_send).toHaveBeenCalledWith(bar); - expect(spy_send).toHaveBeenCalledTimes(2); + expect(spy_write).toHaveBeenCalledWith(foo.toString()); + expect(spy_write).toHaveBeenCalledWith(bar.toString()); + expect(spy_write).toHaveBeenCalledTimes(2); }); diff --git a/packages/xml/package.json b/packages/xml/package.json index bb7eb11f..59c48588 100644 --- a/packages/xml/package.json +++ b/packages/xml/package.json @@ -20,7 +20,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "publishConfig": { "access": "public" diff --git a/packages/xmpp.js/package.json b/packages/xmpp.js/package.json index 368ea788..8d5e3d20 100644 --- a/packages/xmpp.js/package.json +++ b/packages/xmpp.js/package.json @@ -14,7 +14,7 @@ "component" ], "engines": { - "node": ">= 20" + "node": ">= 20.10" }, "dependencies": { "@xmpp/base64": "^0.14.0",