From c124e143aed2bc48765d58cc75a10565798251d7 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 20 Dec 2024 21:01:23 +0100 Subject: [PATCH] f --- CONTRIBUTING.md | 4 +- Makefile | 15 +- ava.config.js | 30 - babel.config.js | 2 +- e2e.config.js | 31 +- eslint.config.mjs | 21 +- jest.config.js | 5 +- package-lock.json | 1645 +---------------------------------- package.json | 4 +- packages/xml/test/Parser.js | 4 +- packages/xmpp.js/test.js | 11 +- test/browser.js | 16 +- test/client.js | 114 ++- test/component.js | 41 +- test/see-other-host.js | 11 +- 15 files changed, 158 insertions(+), 1796 deletions(-) delete mode 100644 ava.config.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d35d5e8d..7ab94415 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,9 +22,9 @@ At that point you can make changes to the xmpp.js code and run tests with make test ``` -If you want to iterate faster, you can watch a test file with `npx ava --watch packages/debug/test.js`. +If you want to iterate faster, you can watch a test file with `npx jest --watch packages/debug/test.js`. -See [ava CLI](https://github.com/avajs/ava/blob/main/docs/05-command-line.md). +See [Jest CLI](https://jestjs.io/docs/cli). ## Submitting diff --git a/Makefile b/Makefile index fb4cb526..4d99866c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: setup lint test ci clean start stop restart bundlesize bundle size cert ncu +.PHONY: setup lint test ci clean start stop restart bundlesize bundle size ncu setup: node packages/xmpp.js/script.js @@ -7,7 +7,7 @@ setup: node bundle.js lint: - ./node_modules/.bin/eslint --cache . + npx eslint --cache . test: cd packages/xmpp.js/ && npm run prepublish @@ -22,11 +22,14 @@ ci: npx jest make lint make restart - ./node_modules/.bin/lerna run prepublish + npx lerna run prepublish node bundle.js - ./node_modules/.bin/ava --config e2e.config.js + make e2e make bundlesize +e2e: + NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.js + clean: make stop rm -f server/localhost.key @@ -34,7 +37,7 @@ clean: rm -f server/prosody.err rm -f server/prosody.log rm -f server/prosody.pid - ./node_modules/.bin/lerna clean --yes + npx lerna clean --yes rm -rf node_modules/ rm -f packages/*/dist/*.js rm -f lerna-debug.log @@ -49,7 +52,7 @@ restart: ./server/ctl.js restart bundlesize: - ./node_modules/.bin/bundlesize + npx bundlesize bundle: node bundle.js diff --git a/ava.config.js b/ava.config.js deleted file mode 100644 index 5751eea6..00000000 --- a/ava.config.js +++ /dev/null @@ -1,30 +0,0 @@ -export default { - babel: { - testOptions: { - babelrc: false, - plugins: [ - [ - "@babel/plugin-transform-react-jsx", - { - pragma: "xml", - throwIfNamespace: false, - }, - ], - [ - "babel-plugin-jsx-pragmatic", - { - module: "@xmpp/xml", - import: "xml", - }, - ], - ], - }, - }, - nodeArguments: ["--experimental-require-module"], - files: [ - "packages/**/test.js", - "packages/**/test/*.js", - "packages/**/*.test.js", - "!packages/test/*.js", - ], -}; diff --git a/babel.config.js b/babel.config.js index ad284f6a..12861b7e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,6 +1,6 @@ "use strict"; -module.exports = (api) => { +module.exports = function config(api) { const isTest = api.env("test"); if (isTest) { diff --git a/e2e.config.js b/e2e.config.js index d507deb6..71764ac7 100644 --- a/e2e.config.js +++ b/e2e.config.js @@ -1,26 +1,7 @@ -export default { - failFast: true, - serial: true, - babel: { - testOptions: { - babelrc: false, - plugins: [ - [ - "@babel/plugin-transform-react-jsx", - { - pragma: "xml", - }, - ], - [ - "babel-plugin-jsx-pragmatic", - { - module: "@xmpp/xml", - import: "xml", - }, - ], - ], - }, - }, - nodeArguments: ["--experimental-require-module"], - files: ["test/*.js"], +"use strict"; + +/** @type {import('jest').Config} */ +module.exports = { + testMatch: ["/test/*.js"], + setupFilesAfterEnv: ["jest-extended/all"], }; diff --git a/eslint.config.mjs b/eslint.config.mjs index 4f3dd962..5784f62e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,8 +12,6 @@ export default [ "**/dist/*.js", "bundle.js", "packages/xmpp.js/index.js", - "ava.config.js", - "e2e.config.js", "eslint.config.mjs", ], }, @@ -64,11 +62,11 @@ export default [ "n/no-unpublished-require": 0, // doesn't play nice with monorepo "n/no-extraneous-require": [ "error", - { allowModules: ["ava", "sinon", "@xmpp/test"] }, + { allowModules: ["sinon", "@xmpp/test"] }, ], "n/no-extraneous-import": [ "error", - { allowModules: ["ava", "sinon", "@xmpp/test"] }, + { allowModules: ["sinon", "@xmpp/test"] }, ], // promise @@ -108,8 +106,19 @@ export default [ "jest/no-disabled-tests": "warn", "jest/no-focused-tests": "error", "jest/no-identical-title": "error", - "jest/prefer-to-have-length": "warn", - "jest/valid-expect": "error", + "jest/prefer-to-have-length": "error", + + // https://github.com/jest-community/eslint-plugin-jest/pull/1688 + "jest/valid-expect": "off", + // "jest/valid-expect": [ + // "error", + // { + // alwaysAwait: true, + // // For jest-extended expect().pass + // minArgs: 0, + // }, + // ], + "promise/no-callback-in-promise": "off", }, }, ]; diff --git a/jest.config.js b/jest.config.js index dc026956..35e0824e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,13 +3,12 @@ const { defaults } = require("jest-config"); /** @type {import('jest').Config} */ -const config = { +module.exports = { testMatch: [...defaults.testMatch, "**/test/*.js"], testPathIgnorePatterns: [ ...defaults.testPathIgnorePatterns, "/test/", "/packages/test/", ], + setupFilesAfterEnv: ["jest-extended/all"], }; - -module.exports = config; diff --git a/package-lock.json b/package-lock.json index a14f11d9..e1c4186d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "serverctl": "server/ctl.js" }, "devDependencies": { - "@ava/babel": "^2.0.0", "@babel/core": "^7.26.0", "@babel/plugin-proposal-object-rest-spread": "^7.16.5", "@babel/plugin-transform-modules-commonjs": "^7.26.3", @@ -19,7 +18,6 @@ "@babel/plugin-transform-runtime": "^7.25.9", "@babel/preset-env": "^7.26.0", "@babel/runtime": "^7.26.0", - "ava": "^3.15.0", "babel-jest": "^29.7.0", "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-transform-async-to-promises": "^0.8.18", @@ -40,6 +38,8 @@ "exorcist": "^2.0.0", "husky": "^9.1.7", "jest": "^29.7.0", + "jest-config": "^29.7.0", + "jest-extended": "^4.0.2", "jsdom": "^25.0.1", "lerna": "^8.1.9", "lint-staged": "^15.2.11", @@ -65,116 +65,6 @@ "node": ">=6.0.0" } }, - "node_modules/@ava/babel": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@ava/require-precompiled": "^1.0.0", - "@babel/core": "^7.14.6", - "@babel/generator": "^7.14.5", - "@babel/plugin-proposal-dynamic-import": "^7.14.5", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", - "@babel/plugin-proposal-optional-chaining": "^7.14.5", - "@babel/plugin-transform-modules-commonjs": "^7.14.5", - "babel-plugin-espower": "^3.0.1", - "concordance": "^5.0.4", - "convert-source-map": "^1.8.0", - "dot-prop": "^6.0.1", - "empower-core": "^1.2.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "is-plain-object": "^5.0.0", - "md5-hex": "^3.0.1", - "package-hash": "^4.0.0", - "pkg-conf": "^3.1.0", - "source-map-support": "^0.5.19", - "strip-bom-buf": "^2.0.0", - "write-file-atomic": "^3.0.3" - }, - "engines": { - "node": ">=12.22 <13 || >=14.16 <15 || >=16" - } - }, - "node_modules/@ava/babel/node_modules/dot-prop": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@ava/babel/node_modules/find-up": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@ava/babel/node_modules/locate-path": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@ava/babel/node_modules/p-limit": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@ava/babel/node_modules/p-locate": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@ava/require-precompiled": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/@babel/cli": { "version": "7.26.4", "license": "MIT", @@ -695,36 +585,6 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-object-rest-spread": { "version": "7.16.5", "dev": true, @@ -743,22 +603,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.21.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-private-property-in-object": { "version": "7.21.0-placeholder-for-preset-env.2", "dev": true, @@ -821,17 +665,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-import-assertions": { "version": "7.26.0", "dev": true, @@ -2008,25 +1841,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@concordance/react": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "arrify": "^1.0.1" - }, - "engines": { - "node": ">=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0" - } - }, - "node_modules/@concordance/react/node_modules/arrify": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@emnapi/core": { "version": "1.3.1", "dev": true, @@ -4082,14 +3896,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "dev": true, @@ -4129,17 +3935,6 @@ "dev": true, "license": "(Unlicense OR Apache-2.0)" }, - "node_modules/@szmarczak/http-timer": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@tufjs/canonical-json": { "version": "2.0.0", "dev": true, @@ -4675,17 +4470,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/add-stream": { "version": "1.0.0", "dev": true, @@ -4726,14 +4510,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-align": { - "version": "3.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.1.0" - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "dev": true, @@ -4819,14 +4595,6 @@ "node": ">=8" } }, - "node_modules/array-find-index": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-from": { "version": "2.1.1", "dev": true, @@ -4845,14 +4613,6 @@ "node": ">=8" } }, - "node_modules/arrgv": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/arrify": { "version": "2.0.1", "dev": true, @@ -4899,14 +4659,6 @@ "inherits": "2.0.1" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/async": { "version": "3.2.6", "dev": true, @@ -4917,122 +4669,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ava": { - "version": "3.15.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@concordance/react": "^2.0.0", - "acorn": "^8.0.4", - "acorn-walk": "^8.0.0", - "ansi-styles": "^5.0.0", - "arrgv": "^1.0.2", - "arrify": "^2.0.1", - "callsites": "^3.1.0", - "chalk": "^4.1.0", - "chokidar": "^3.4.3", - "chunkd": "^2.0.1", - "ci-info": "^2.0.0", - "ci-parallel-vars": "^1.0.1", - "clean-yaml-object": "^0.1.0", - "cli-cursor": "^3.1.0", - "cli-truncate": "^2.1.0", - "code-excerpt": "^3.0.0", - "common-path-prefix": "^3.0.0", - "concordance": "^5.0.1", - "convert-source-map": "^1.7.0", - "currently-unhandled": "^0.4.1", - "debug": "^4.3.1", - "del": "^6.0.0", - "emittery": "^0.8.0", - "equal-length": "^1.0.0", - "figures": "^3.2.0", - "globby": "^11.0.1", - "ignore-by-default": "^2.0.0", - "import-local": "^3.0.2", - "indent-string": "^4.0.0", - "is-error": "^2.2.2", - "is-plain-object": "^5.0.0", - "is-promise": "^4.0.0", - "lodash": "^4.17.20", - "matcher": "^3.0.0", - "md5-hex": "^3.0.1", - "mem": "^8.0.0", - "ms": "^2.1.3", - "ora": "^5.2.0", - "p-event": "^4.2.0", - "p-map": "^4.0.0", - "picomatch": "^2.2.2", - "pkg-conf": "^3.1.0", - "plur": "^4.0.0", - "pretty-ms": "^7.0.1", - "read-pkg": "^5.2.0", - "resolve-cwd": "^3.0.0", - "slash": "^3.0.0", - "source-map-support": "^0.5.19", - "stack-utils": "^2.0.3", - "strip-ansi": "^6.0.0", - "supertap": "^2.0.0", - "temp-dir": "^2.0.0", - "trim-off-newlines": "^1.0.1", - "update-notifier": "^5.0.1", - "write-file-atomic": "^3.0.3", - "yargs": "^16.2.0" - }, - "bin": { - "ava": "cli.js" - }, - "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <12.17.0 || >=12.17.0 <13 || >=14.0.0 <15 || >=15" - } - }, - "node_modules/ava/node_modules/ci-info": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ava/node_modules/cli-truncate": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ava/node_modules/slice-ansi": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ava/node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.4", "dev": true, @@ -5075,20 +4711,6 @@ "@babel/core": "^7.8.0" } }, - "node_modules/babel-plugin-espower": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "call-matcher": "^1.0.0", - "core-js": "^2.0.0", - "espower-location-detector": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.1.1" - } - }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -5324,8 +4946,8 @@ }, "node_modules/binary-extensions": { "version": "2.2.0", - "devOptional": true, "license": "MIT", + "optional": true, "engines": { "node": ">=8" } @@ -5376,59 +4998,11 @@ "node": ">= 6" } }, - "node_modules/blueimp-md5": { - "version": "2.18.0", - "dev": true, - "license": "MIT" - }, "node_modules/bn.js": { "version": "5.2.0", "dev": true, "license": "MIT" }, - "node_modules/boxen": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/camelcase": { - "version": "6.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/boxen/node_modules/type-fest": { - "version": "0.20.2", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "license": "MIT", @@ -5851,45 +5425,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacheable-request": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/cached-path-relative": { "version": "1.0.2", "dev": true, @@ -5922,25 +5457,6 @@ "node": ">= 0.4" } }, - "node_modules/call-matcher": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "core-js": "^2.0.0", - "deep-equal": "^1.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.0.0" - } - }, - "node_modules/call-signature": { - "version": "0.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -6069,8 +5585,8 @@ }, "node_modules/chokidar": { "version": "3.6.0", - "devOptional": true, "license": "MIT", + "optional": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -6098,11 +5614,6 @@ "node": ">=10" } }, - "node_modules/chunkd": { - "version": "2.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/ci-env": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/ci-env/-/ci-env-1.17.0.tgz", @@ -6123,11 +5634,6 @@ "node": ">=8" } }, - "node_modules/ci-parallel-vars": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/cipher-base": { "version": "1.0.4", "license": "MIT", @@ -6169,25 +5675,6 @@ "node": ">=6" } }, - "node_modules/clean-yaml-object": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cli-boxes": { - "version": "2.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/cli-cursor": { "version": "3.1.0", "dev": true, @@ -6319,25 +5806,6 @@ "node": ">=0.10.0" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/clone-response/node_modules/mimic-response": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/cmd-shim": { "version": "6.0.3", "dev": true, @@ -6356,17 +5824,6 @@ "node": ">= 0.12.0" } }, - "node_modules/code-excerpt": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "convert-to-spaces": "^1.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -6461,11 +5918,6 @@ "dev": true, "license": "ISC" }, - "node_modules/common-path-prefix": { - "version": "3.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/common-shakeify": { "version": "1.1.2", "dev": true, @@ -6509,54 +5961,6 @@ "typedarray": "^0.0.6" } }, - "node_modules/concordance": { - "version": "5.0.4", - "dev": true, - "license": "ISC", - "dependencies": { - "date-time": "^3.1.0", - "esutils": "^2.0.3", - "fast-diff": "^1.2.0", - "js-string-escape": "^1.0.1", - "lodash": "^4.17.15", - "md5-hex": "^3.0.1", - "semver": "^7.3.2", - "well-known-symbols": "^2.0.0" - }, - "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" - } - }, - "node_modules/concordance/node_modules/semver": { - "version": "7.3.5", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/configstore": { - "version": "5.0.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/console-browserify": { "version": "1.2.0", "dev": true @@ -6910,20 +6314,6 @@ "dev": true, "license": "MIT" }, - "node_modules/convert-to-spaces": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/core-js": { - "version": "2.6.12", - "dev": true, - "hasInstallScript": true, - "license": "MIT" - }, "node_modules/core-js-compat": { "version": "3.39.0", "dev": true, @@ -7055,14 +6445,6 @@ "node": "*" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/cssesc": { "version": "3.0.0", "dev": true, @@ -7085,17 +6467,6 @@ "node": ">=18" } }, - "node_modules/currently-unhandled": { - "version": "0.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "array-find-index": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/d": { "version": "1.0.1", "dev": true, @@ -7130,17 +6501,6 @@ "node": ">=18" } }, - "node_modules/date-time": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "time-zone": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/dateformat": { "version": "3.0.3", "dev": true, @@ -7217,25 +6577,6 @@ "dev": true, "license": "MIT" }, - "node_modules/deep-equal": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-arguments": "^1.1.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.5.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "dev": true, @@ -7266,11 +6607,6 @@ "clone": "^1.0.2" } }, - "node_modules/defer-to-connect": { - "version": "1.1.3", - "dev": true, - "license": "MIT" - }, "node_modules/define-data-property": { "version": "1.1.4", "license": "MIT", @@ -7314,27 +6650,6 @@ "dev": true, "license": "MIT" }, - "node_modules/del": { - "version": "6.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "globby": "^11.0.1", - "graceful-fs": "^4.2.4", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.2", - "p-map": "^4.0.0", - "rimraf": "^3.0.2", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "dev": true, @@ -7534,11 +6849,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/duplexer3": { - "version": "0.1.5", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/eastasianwidth": { "version": "0.2.0", "dev": true, @@ -7581,31 +6891,11 @@ "dev": true, "license": "MIT" }, - "node_modules/emittery": { - "version": "0.8.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "dev": true, "license": "MIT" }, - "node_modules/empower-core": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - }, "node_modules/encoding": { "version": "0.1.13", "license": "MIT", @@ -7697,14 +6987,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/equal-length": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/err-code": { "version": "2.0.3", "dev": true, @@ -7796,11 +7078,6 @@ "next-tick": "~1.0.0" } }, - "node_modules/es6-error": { - "version": "4.1.1", - "dev": true, - "license": "MIT" - }, "node_modules/es6-iterator": { "version": "2.0.3", "dev": true, @@ -7872,14 +7149,6 @@ "node": ">=6" } }, - "node_modules/escape-goat": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -8387,17 +7656,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/espower-location-detector": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-url": "^1.2.1", - "path-is-absolute": "^1.0.0", - "source-map": "^0.5.0", - "xtend": "^4.0.0" - } - }, "node_modules/espree": { "version": "10.3.0", "dev": true, @@ -8426,14 +7684,6 @@ "node": ">=4" } }, - "node_modules/espurify": { - "version": "1.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "core-js": "^2.0.0" - } - }, "node_modules/esquery": { "version": "1.6.0", "dev": true, @@ -8658,11 +7908,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-diff": { - "version": "1.2.0", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/fast-glob": { "version": "3.3.2", "dev": true, @@ -8980,7 +8225,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -8997,14 +8241,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -9340,28 +8576,6 @@ "node": ">= 6" } }, - "node_modules/global-dirs": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/globals": { "version": "11.12.0", "license": "MIT", @@ -9398,57 +8612,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "9.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/got/node_modules/decompress-response": { - "version": "3.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/got/node_modules/get-stream": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/got/node_modules/mimic-response": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "dev": true, @@ -9585,14 +8748,6 @@ "dev": true, "license": "ISC" }, - "node_modules/has-yarn": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/hash-base": { "version": "3.1.0", "license": "MIT", @@ -9626,29 +8781,6 @@ "minimalistic-assert": "^1.0.1" } }, - "node_modules/hasha": { - "version": "5.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=8" - } - }, "node_modules/hasown": { "version": "2.0.2", "license": "MIT", @@ -9814,14 +8946,6 @@ "node": ">= 4" } }, - "node_modules/ignore-by-default": { - "version": "2.1.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10 <11 || >=12 <13 || >=14" - } - }, "node_modules/ignore-walk": { "version": "6.0.5", "dev": true, @@ -9892,14 +9016,6 @@ "node": ">=4" } }, - "node_modules/import-lazy": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/import-local": { "version": "3.1.0", "dev": true, @@ -10118,14 +9234,6 @@ "version": "1.3.1", "license": "Unlicense" }, - "node_modules/irregular-plurals": { - "version": "3.5.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-arguments": { "version": "1.1.1", "dev": true, @@ -10158,8 +9266,8 @@ }, "node_modules/is-binary-path": { "version": "2.1.0", - "devOptional": true, "license": "MIT", + "optional": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -10210,22 +9318,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-ci/node_modules/ci-info": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/is-core-module": { "version": "2.6.0", "dev": true, @@ -10273,11 +9365,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-error": { - "version": "2.2.2", - "dev": true, - "license": "MIT" - }, "node_modules/is-extglob": { "version": "2.1.1", "devOptional": true, @@ -10328,21 +9415,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-interactive": { "version": "1.0.0", "dev": true, @@ -10366,17 +9438,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-npm": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-number": { "version": "7.0.0", "devOptional": true, @@ -10406,22 +9467,6 @@ "node": ">=8" } }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "1.1.0", "dev": true, @@ -10443,11 +9488,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-promise": { - "version": "4.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/is-regex": { "version": "1.1.4", "license": "MIT", @@ -10536,11 +9576,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "dev": true, @@ -10552,16 +9587,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-url": { - "version": "1.2.4", - "dev": true, - "license": "MIT" - }, - "node_modules/is-utf8": { - "version": "0.2.1", - "dev": true, - "license": "MIT" - }, "node_modules/is-wsl": { "version": "2.2.0", "dev": true, @@ -10573,11 +9598,6 @@ "node": ">=8" } }, - "node_modules/is-yarn-global": { - "version": "0.3.0", - "dev": true, - "license": "MIT" - }, "node_modules/isarray": { "version": "1.0.0", "dev": true, @@ -11039,6 +10059,27 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-extended": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jest-extended/-/jest-extended-4.0.2.tgz", + "integrity": "sha512-FH7aaPgtGYHc9mRjriS0ZEHYM5/W69tLrFTIdzm+yJgeoCmmrSB/luSfMSqWP9O29QWHPEmJ4qmU6EwsZideog==", + "dev": true, + "dependencies": { + "jest-diff": "^29.0.0", + "jest-get-type": "^29.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "jest": ">=27.2.5" + }, + "peerDependenciesMeta": { + "jest": { + "optional": true + } + } + }, "node_modules/jest-get-type": { "version": "29.6.3", "dev": true, @@ -11454,14 +10495,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/js-string-escape": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "license": "MIT" @@ -11532,11 +10565,6 @@ "node": ">=6" } }, - "node_modules/json-buffer": { - "version": "3.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "dev": true, @@ -11634,14 +10662,6 @@ "dev": true, "license": "MIT" }, - "node_modules/keyv": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.0" - } - }, "node_modules/kind-of": { "version": "6.0.3", "license": "MIT", @@ -11671,17 +10691,6 @@ "stream-splicer": "^2.0.0" } }, - "node_modules/latest-version": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "package-json": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/lerna": { "version": "8.1.9", "dev": true, @@ -12517,11 +11526,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.get": { "version": "4.4.2", "dev": true, @@ -12774,14 +11778,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/lowercase-keys": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/lru-cache": { "version": "6.0.0", "dev": true, @@ -12808,20 +11804,6 @@ "sourcemap-codec": "^1.4.1" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/make-fetch-happen": { "version": "13.0.1", "dev": true, @@ -12853,17 +11835,6 @@ "tmpl": "1.0.5" } }, - "node_modules/map-age-cleaner": { - "version": "0.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "p-defer": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/map-obj": { "version": "4.3.0", "dev": true, @@ -12875,17 +11846,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/matcher": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/math-intrinsics": { "version": "1.1.0", "license": "MIT", @@ -12893,17 +11853,6 @@ "node": ">= 0.4" } }, - "node_modules/md5-hex": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "blueimp-md5": "^2.10.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/md5.js": { "version": "1.3.5", "license": "MIT", @@ -12913,29 +11862,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/mem": { - "version": "8.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/mem?sponsor=1" - } - }, - "node_modules/mem/node_modules/mimic-fn": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/meow": { "version": "8.1.2", "dev": true, @@ -13748,14 +12674,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-url": { - "version": "4.5.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/npm-bundled": { "version": "3.0.1", "dev": true, @@ -14098,21 +13016,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "license": "MIT", @@ -14276,36 +13179,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-cancelable": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/p-defer": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/p-event": { - "version": "4.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-timeout": "^3.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-finally": { "version": "1.0.0", "dev": true, @@ -14431,34 +13304,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-hash": { - "version": "4.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/package-json": { - "version": "6.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.1", "dev": true, @@ -14563,14 +13408,6 @@ "node": ">=4" } }, - "node_modules/parse-ms": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/parse-passwd": { "version": "1.0.0", "license": "MIT", @@ -14738,99 +13575,6 @@ "node": ">= 6" } }, - "node_modules/pkg-conf": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^3.0.0", - "load-json-file": "^5.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/find-up": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/load-json-file": { - "version": "5.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/locate-path": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/p-locate": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/path-exists": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/pify": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-conf/node_modules/strip-bom": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/pkg-conf/node_modules/type-fest": { - "version": "0.3.1", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=6" - } - }, "node_modules/pkg-dir": { "version": "3.0.0", "license": "MIT", @@ -14876,21 +13620,7 @@ "version": "3.0.0", "license": "MIT", "engines": { - "node": ">=4" - } - }, - "node_modules/plur": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "irregular-plurals": "^3.2.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, "node_modules/pluralize": { @@ -14950,14 +13680,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prepend-http": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { "version": "3.4.2", "dev": true, @@ -14993,20 +13715,6 @@ "node": ">= 0.8" } }, - "node_modules/pretty-ms": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "parse-ms": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/prettycli": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/prettycli/-/prettycli-1.4.3.tgz", @@ -15215,17 +13923,6 @@ "dev": true, "license": "MIT" }, - "node_modules/pupa": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-goat": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -15497,8 +14194,8 @@ }, "node_modules/readdirp": { "version": "3.6.0", - "devOptional": true, "license": "MIT", + "optional": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -15554,23 +14251,6 @@ "regexp-tree": "bin/regexp-tree" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/regexpp": { "version": "3.2.0", "dev": true, @@ -15620,28 +14300,6 @@ "regjsparser": "bin/parser" } }, - "node_modules/registry-auth-token": { - "version": "4.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/registry-url": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "rc": "^1.2.8" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/regjsgen": { "version": "0.8.0", "dev": true, @@ -15665,17 +14323,6 @@ "jsesc": "bin/jsesc" } }, - "node_modules/release-zalgo": { - "version": "1.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "es6-error": "^4.0.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/require-directory": { "version": "2.1.1", "dev": true, @@ -15733,14 +14380,6 @@ "node": ">=10" } }, - "node_modules/responselike": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, "node_modules/restore-cursor": { "version": "3.1.0", "dev": true, @@ -15775,20 +14414,6 @@ "dev": true, "license": "MIT" }, - "node_modules/rimraf": { - "version": "3.0.2", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "license": "MIT", @@ -15935,42 +14560,6 @@ "semver": "bin/semver.js" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/serialize-error": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.13.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/serialize-error/node_modules/type-fest": { - "version": "0.13.1", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/set-blocking": { "version": "2.0.0", "dev": true, @@ -15991,20 +14580,6 @@ "node": ">= 0.4" } }, - "node_modules/set-function-name": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/sha.js": { "version": "2.4.11", "license": "(MIT AND BSD-3-Clause)", @@ -16539,17 +15114,6 @@ "node": ">=8" } }, - "node_modules/strip-bom-buf": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-utf8": "^0.2.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "dev": true, @@ -16604,21 +15168,6 @@ "minimist": "^1.1.0" } }, - "node_modules/supertap": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "arrify": "^2.0.1", - "indent-string": "^4.0.0", - "js-yaml": "^3.14.0", - "serialize-error": "^7.0.1", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/supports-color": { "version": "7.2.0", "dev": true, @@ -16743,14 +15292,6 @@ "node": ">=8" } }, - "node_modules/temp-dir": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -16787,14 +15328,6 @@ "xtend": "~4.0.1" } }, - "node_modules/time-zone": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/timers-browserify": { "version": "1.4.2", "dev": true, @@ -16835,14 +15368,6 @@ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, - "node_modules/to-readable-stream": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "devOptional": true, @@ -16936,14 +15461,6 @@ "node": ">=8" } }, - "node_modules/trim-off-newlines": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ts-api-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", @@ -17052,14 +15569,6 @@ "dev": true, "license": "MIT" }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { "version": "5.7.2", "dev": true, @@ -17182,17 +15691,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/unique-string": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/universal-user-agent": { "version": "6.0.1", "dev": true, @@ -17243,44 +15741,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/update-notifier": { - "version": "5.1.0", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "boxen": "^5.0.0", - "chalk": "^4.1.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.4.0", - "is-npm": "^5.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.1.0", - "pupa": "^2.1.1", - "semver": "^7.3.4", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/yeoman/update-notifier?sponsor=1" - } - }, - "node_modules/update-notifier/node_modules/semver": { - "version": "7.6.3", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/uri-js": { "version": "4.4.1", "dev": true, @@ -17306,17 +15766,6 @@ "querystring": "0.2.0" } }, - "node_modules/url-parse-lax": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/url/node_modules/punycode": { "version": "1.3.2", "dev": true, @@ -17444,14 +15893,6 @@ "node": ">=12" } }, - "node_modules/well-known-symbols": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=6" - } - }, "node_modules/whatwg-encoding": { "version": "3.1.1", "dev": true, @@ -17558,17 +15999,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/widest-line": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "dev": true, @@ -17652,17 +16082,6 @@ "version": "1.0.2", "license": "ISC" }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "node_modules/write-json-file": { "version": "3.2.0", "dev": true, @@ -17757,14 +16176,6 @@ } } }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/xml-name-validator": { "version": "5.0.0", "dev": true, diff --git a/package.json b/package.json index 873f5847..3f49a165 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "serverctl": "server/ctl.js" }, "devDependencies": { - "@ava/babel": "^2.0.0", "@babel/core": "^7.26.0", "@babel/plugin-proposal-object-rest-spread": "^7.16.5", "@babel/plugin-transform-modules-commonjs": "^7.26.3", @@ -13,7 +12,6 @@ "@babel/plugin-transform-runtime": "^7.25.9", "@babel/preset-env": "^7.26.0", "@babel/runtime": "^7.26.0", - "ava": "^3.15.0", "babel-jest": "^29.7.0", "babel-plugin-jsx-pragmatic": "^1.0.2", "babel-plugin-transform-async-to-promises": "^0.8.18", @@ -34,6 +32,8 @@ "exorcist": "^2.0.0", "husky": "^9.1.7", "jest": "^29.7.0", + "jest-config": "^29.7.0", + "jest-extended": "^4.0.2", "jsdom": "^25.0.1", "lerna": "^8.1.9", "lint-staged": "^15.2.11", diff --git a/packages/xml/test/Parser.js b/packages/xml/test/Parser.js index 9a44e053..eca7891e 100644 --- a/packages/xml/test/Parser.js +++ b/packages/xml/test/Parser.js @@ -2,7 +2,7 @@ const Parser = require("../lib/Parser"); -test("stream parser", done => { +test("stream parser", (done) => { const parser = new Parser(); expect.assertions(5); @@ -16,7 +16,7 @@ test("stream parser", done => { parser.on("element", (el) => { expect(el.parent).toBe(startElement); - expect(startElement.children.length).toBe(0); + expect(startElement.children).toHaveLength(0); expect(el.toString()).toBe("hello"); }); diff --git a/packages/xmpp.js/test.js b/packages/xmpp.js/test.js index 6ecb6425..c822e800 100644 --- a/packages/xmpp.js/test.js +++ b/packages/xmpp.js/test.js @@ -9,12 +9,9 @@ const packages = Object.fromEntries( // For some reason there's a "*" file on travis .filter((p) => !["*"].includes(p) && !p.includes(".")) .map((dirname) => { - const { name, version } = require(path.join( - __dirname, - "..", - dirname, - "package.json", - )); + const { name, version } = require( + path.join(__dirname, "..", dirname, "package.json"), + ); return [name, `^${version}`]; }), ); @@ -22,6 +19,6 @@ const packages = Object.fromEntries( const { dependencies } = require("./package.json"); test("depends on all other packages", () => { - expect(Object.keys(dependencies).length).toBe(Object.keys(packages).length); + expect(Object.keys(dependencies)).toHaveLength(Object.keys(packages).length); expect(dependencies).toEqual(packages); }); diff --git a/test/browser.js b/test/browser.js index a0fa8d23..8200bee1 100644 --- a/test/browser.js +++ b/test/browser.js @@ -21,19 +21,25 @@ const xmppjs = readFileSync("./packages/client/dist/xmpp.js", { encoding: "utf8", }); -beforeEach(() => { - const { window } = new JSDOM(``, { runScripts: "dangerously" }); +let window; +let xmpp; + +beforeEach(async () => { + ({ window } = new JSDOM(``, { runScripts: "dangerously" })); window.fetch = fetch; const { document } = window; const scriptEl = document.createElement("script"); scriptEl.textContent = xmppjs; document.body.append(scriptEl); - t.context = window.XMPP.client; - return server.restart(); + await server.restart(); +}); + +afterEach(async () => { + await xmpp?.stop(); }); test("client ws://", async () => { - const xmpp = t.context({ + xmpp = window.XMPP.client({ credentials, service, }); diff --git a/test/client.js b/test/client.js index 50c4f3a5..316a5e3f 100644 --- a/test/client.js +++ b/test/client.js @@ -12,24 +12,25 @@ const credentials = { username, password }; const domain = "localhost"; const JID = jid(username, domain).toString(); -beforeEach(() => { - return server.restart(); +let xmpp; + +beforeEach(async () => { + await server.restart(); }); -afterEach(() => { - if (t.context.xmpp && t.context.xmpp.status === "online") { - return t.context.xmpp.stop(); - } +afterEach(async () => { + await xmpp?.stop(); }); test("client", async () => { expect.assertions(6); - const xmpp = client({ credentials, service: domain }); - t.context.xmpp = xmpp; + xmpp = client({ credentials, service: domain }); debug(xmpp); - xmpp.on("connect", () => {}); + xmpp.on("connect", () => { + expect().pass(); + }); xmpp.once("open", (el) => { expect(el instanceof xml.Element).toBe(true); @@ -45,10 +46,10 @@ test("client", async () => { expect(address.bare().toString()).toBe(JID); }); -test("bad credentials", done => { +test("bad credentials", (done) => { expect.assertions(6); - const xmpp = client({ + xmpp = client({ service: domain, credentials: { ...credentials, password: "nope" }, }); @@ -56,8 +57,12 @@ test("bad credentials", done => { let error; - xmpp.on("connect", () => ); - xmpp.once("open", () => ); + xmpp.on("connect", () => { + expect().pass(); + }); + xmpp.once("open", () => { + expect().pass(); + }); xmpp.on("online", () => done.fail()); @@ -75,21 +80,20 @@ test("bad credentials", done => { expect(err).toBe(error); done(); }); - - t.context.xmpp = xmpp; }); -test("reconnects when server restarts gracefully", done => { +test("reconnects when server restarts gracefully", (done) => { expect.assertions(2); let c = 0; - const xmpp = client({ credentials, service: domain }); + xmpp = client({ credentials, service: domain }); debug(xmpp); xmpp.on("error", () => {}); xmpp.on("online", async () => { c++; + expect().pass(); if (c === 2) { await xmpp.stop(); done(); @@ -99,21 +103,20 @@ test("reconnects when server restarts gracefully", done => { }); xmpp.start(); - - t.context.xmpp = xmpp; }); -test("reconnects when server restarts non-gracefully", done => { +test("reconnects when server restarts non-gracefully", (done) => { expect.assertions(2); let c = 0; - const xmpp = client({ credentials, service: domain }); + xmpp = client({ credentials, service: domain }); debug(xmpp); xmpp.on("error", () => {}); xmpp.on("online", async () => { c++; + expect().pass(); if (c === 2) { await xmpp.stop(); done(); @@ -123,14 +126,12 @@ test("reconnects when server restarts non-gracefully", done => { }); xmpp.start(); - - t.context.xmpp = xmpp; }); -test("does not reconnect when stop is called", done => { +test("does not reconnect when stop is called", (done) => { expect.assertions(2); - const xmpp = client({ service: domain, credentials }); + xmpp = client({ service: domain, credentials }); debug(xmpp); xmpp.on("online", async () => { @@ -139,19 +140,21 @@ test("does not reconnect when stop is called", done => { done(); }); - xmpp.on("close", () => ); + xmpp.on("close", () => { + expect().pass(); + }); - xmpp.on("offline", () => ); + xmpp.on("offline", () => { + expect().pass(); + }); xmpp.start(); - - t.context.xmpp = xmpp; }); -test("anonymous authentication", done => { +test("anonymous authentication", (done) => { expect.assertions(2); - const xmpp = client({ service: domain, domain: "anon." + domain }); + xmpp = client({ service: domain, domain: "anon." + domain }); debug(xmpp); xmpp.on("online", async () => { @@ -160,147 +163,136 @@ test("anonymous authentication", done => { done(); }); - xmpp.on("close", () => ); + xmpp.on("close", () => { + expect().pass(); + }); - xmpp.on("offline", () => ); + xmpp.on("offline", () => { + expect().pass(); + }); xmpp.start(); - - t.context.xmpp = xmpp; }); test("auto", async () => { - const xmpp = client({ credentials, service: domain }); + xmpp = client({ credentials, service: domain }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("ws IPv4", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "ws://127.0.0.1:5280/xmpp-websocket", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("ws IPv6", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "ws://[::1]:5280/xmpp-websocket", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("ws domain", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "ws://localhost:5280/xmpp-websocket", }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); // Prosody 404 https://prosody.im/issues/issue/932 test("wss IPv4", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "wss://127.0.0.1:5281/xmpp-websocket", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); // Prosody 404 https://prosody.im/issues/issue/932 test("wss IPv6", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "wss://[::1]:5281/xmpp-websocket", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("wss domain", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "wss://localhost:5281/xmpp-websocket", }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpp IPv4", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "xmpp://127.0.0.1:5222", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpp IPv6", async () => { - const xmpp = client({ credentials, service: "xmpp://[::1]:5222", domain }); + xmpp = client({ credentials, service: "xmpp://[::1]:5222", domain }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpp domain", async () => { - const xmpp = client({ credentials, service: "xmpp://localhost:5222" }); + xmpp = client({ credentials, service: "xmpp://localhost:5222" }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpps IPv4", async () => { - const xmpp = client({ + xmpp = client({ credentials, service: "xmpps://127.0.0.1:5223", domain, }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpps IPv6", async () => { - const xmpp = client({ credentials, service: "xmpps://[::1]:5223", domain }); + xmpp = client({ credentials, service: "xmpps://[::1]:5223", domain }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); test("xmpps domain", async () => { - const xmpp = client({ credentials, service: "xmpps://localhost:5223" }); + xmpp = client({ credentials, service: "xmpps://localhost:5223" }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); }); diff --git a/test/component.js b/test/component.js index 65395d5f..54a612ad 100644 --- a/test/component.js +++ b/test/component.js @@ -9,24 +9,24 @@ const service = "xmpp://localhost:5347"; const domain = "component.localhost"; const options = { password, service, domain }; +let xmpp; + beforeEach(() => { + xmpp = component(options); + debug(xmpp); return server.restart(); }); -afterEach(() => { - if (t.context.xmpp) { - return t.context.xmpp.stop(); - } +afterEach(async () => { + await xmpp?.stop(); }); test("component", async () => { expect.assertions(6); - const xmpp = component(options); - t.context.xmpp = xmpp; - debug(xmpp); - - xmpp.on("connect", () => {}); + xmpp.on("connect", () => { + expect().pass(); + }); xmpp.on("open", (el) => { expect(el instanceof xml.Element).toBe(true); @@ -44,17 +44,15 @@ test("component", async () => { await xmpp.stop; }); -test("reconnects when server restarts", done => { +test("reconnects when server restarts", (done) => { expect.assertions(2); let c = 0; - const xmpp = component(options); - debug(xmpp); - xmpp.on("error", () => {}); xmpp.on("online", async () => { c++; + expect().pass(); if (c === 2) { await xmpp.stop(); done(); @@ -64,27 +62,24 @@ test("reconnects when server restarts", done => { }); xmpp.start(); - - t.context.xmpp = xmpp; }); -test("does not reconnect when stop is called", done => { +test("does not reconnect when stop is called", (done) => { expect.assertions(2); - const xmpp = component(options); - debug(xmpp); - xmpp.on("online", async () => { await xmpp.stop(); await server.stop(); done(); }); - xmpp.on("close", () => ); + xmpp.on("close", () => { + expect().pass(); + }); - xmpp.on("offline", () => ); + xmpp.on("offline", () => { + expect().pass(); + }); xmpp.start(); - - t.context.xmpp = xmpp; }); diff --git a/test/see-other-host.js b/test/see-other-host.js index 2ad4a675..f5eea946 100644 --- a/test/see-other-host.js +++ b/test/see-other-host.js @@ -12,14 +12,14 @@ const credentials = { username, password }; const domain = "localhost"; const JID = jid(username, domain).toString(); +let xmpp; + beforeEach(() => { return server.restart(); }); -afterEach(() => { - if (t.context.xmpp && t.context.xmpp.status === "online") { - return t.context.xmpp.stop(); - } +afterEach(async () => { + await xmpp?.stop(); }); test("see-other-host", async () => { @@ -45,9 +45,8 @@ test("see-other-host", async () => { seeOtherHostServer.listen(5486); await promise(seeOtherHostServer, "listening"); - const xmpp = client({ credentials, service: "xmpp://localhost:5486" }); + xmpp = client({ credentials, service: "xmpp://localhost:5486" }); debug(xmpp); - t.context.xmpp = xmpp; const address = await xmpp.start(); expect(address.bare().toString()).toBe(JID); });