From 04d6429409497ee9f5c8fc274782ea38179b5290 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 22 Sep 2023 17:48:56 +0200 Subject: [PATCH 01/12] @uppy/svelte: revert breaking change (#4694) --- packages/@uppy/svelte/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/svelte/package.json b/packages/@uppy/svelte/package.json index 47748947ce..13d49b6a48 100644 --- a/packages/@uppy/svelte/package.json +++ b/packages/@uppy/svelte/package.json @@ -33,7 +33,7 @@ "@uppy/drag-drop": "workspace:^", "@uppy/progress-bar": "workspace:^", "@uppy/status-bar": "workspace:^", - "svelte": "^4.0.0" + "svelte": "^3.0.0 || ^4.0.0" }, "publishConfig": { "access": "public" From 889653ebc6015d76b77885a20b2ae410160c0c0b Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 23 Sep 2023 12:56:32 +0800 Subject: [PATCH 02/12] run type checks also for companion and add files to docker (#4688) * run type checks also for companion * add docker build to PRs * add missing checkout * try to copy everything * try to fix issue * Update .github/workflows/companion.yml * Update .dockerignore --- .dockerignore | 3 +++ .github/workflows/companion.yml | 2 ++ Dockerfile | 4 +--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index ef71f62e07..137589ad02 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,6 @@ .git website assets +private +e2e +.env diff --git a/.github/workflows/companion.yml b/.github/workflows/companion.yml index 915ce06e21..94e6841877 100644 --- a/.github/workflows/companion.yml +++ b/.github/workflows/companion.yml @@ -46,4 +46,6 @@ jobs: run: corepack yarn workspaces focus @uppy/companion - name: Run tests run: corepack yarn run test:companion + - name: Run type checks in focused workspace + run: corepack yarn run build:companion diff --git a/Dockerfile b/Dockerfile index 73ee416382..dd2891d375 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,7 @@ RUN if [ "$(uname -m)" == "aarch64" ]; then mkdir -p /usr/local/sbin/ && ln -s / WORKDIR /app -COPY package.json .yarnrc.yml /app/ -COPY .yarn /app/.yarn -COPY packages/@uppy/companion /app/packages/@uppy/companion +COPY . /app/ RUN apk --update add --virtual native-dep \ make gcc g++ python3 libgcc libstdc++ git && \ From 87a28ed18d7f6726e9714677be6701fe853352c0 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 23 Sep 2023 16:30:39 +0800 Subject: [PATCH 03/12] add companion hotfix doc (#4683) * add companion hotfix doc * Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c7bc9a0082..093fb7fb6c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -178,6 +178,67 @@ Releases are managed by GitHub Actions, here’s an overview of the process to r If you don’t have access to the transloadit.com source code ping @arturi or @goto-bus-stop and we’ll pick it up. :sparkles: +### Releasing hotfix patch + +#### Companion hotfix + +First checkout the tag of the version you want to patch: +```bash +git checkout @uppy/companion@x.y.z +``` + +Now create a branch for your hotfix: +```bash +git checkout -b x.y.z-hotfix +``` + +Run yarn to make sure all packages are consistent: +```bash +corepack yarn +``` + +Now navigate to the Companion workspace: +```bash +cd packages/@uppy/companion +``` + +**Now cherry pick your desired commits** + +Next edit `CHANGELOG.md` and then commit it: +```bash +git add CHANGELOG.md +git commit -m 'Update changelog' +``` + +Now let's create the version & tag +```bash +mkdir -p .git && npm version --workspaces-update=false --tag-version-prefix='@uppy/companion@' patch +``` + +Run a "dry-run" first: + +```bash +corepack yarn pack +``` + +If the previous command succeeded, let's publish! + +```bash +corepack yarn npm publish --access public --tag=none +``` + +Now we can push our branch and tags. + +```bash +git push && git push --tags +``` + +#### Hotfix other packages + +For other Uppy packages, the process should be similar to Companion, +but hasn't been documented yet. Make sure to remember to run `yarn` as well as building the package first, then you can release it. +If you do release any other packages, please update this doc. + ## CSS guidelines The CSS standards followed in this project closely resemble those from [Medium’s CSS Guidelines](https://gist.github.com/fat/a47b882eb5f84293c4ed). If something is not mentioned here, follow their guidelines. From b1e4a5b915d2e9a4b48c95ac4f11adfd77ad0074 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 25 Sep 2023 18:52:18 +0800 Subject: [PATCH 04/12] fix a refresh token race condition (#4695) that would be triggered when uploading multiple files in parallell if a 401 occurs, it would cause multiple refresh-token requests to be fired in parallel also only call refresh-token if we have a token and reset the token if refresh-token fails with 401 --- .../@uppy/companion-client/src/Provider.js | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/@uppy/companion-client/src/Provider.js b/packages/@uppy/companion-client/src/Provider.js index 58e4e9e046..88969b1d0a 100644 --- a/packages/@uppy/companion-client/src/Provider.js +++ b/packages/@uppy/companion-client/src/Provider.js @@ -161,22 +161,33 @@ export default class Provider extends RequestClient { try { // throw Object.assign(new Error(), { isAuthError: true }) // testing simulate access token expired (to refresh token) + // A better way to test this is for example with Google Drive: + // While uploading, go to your google account settings, + // "Third-party apps & services", then click "Companion" and "Remove access". + return await super.request(...args) } catch (err) { - if (!err.isAuthError) throw err // only handle auth errors (401 from provider) - - await this.#refreshingTokenPromise - - // Many provider requests may be starting at once, however refresh token should only be called once. - // Once a refresh token operation has started, we need all other request to wait for this operation (atomically) - this.#refreshingTokenPromise = (async () => { - try { - const response = await super.request({ path: this.refreshTokenUrl(), method: 'POST' }) - await this.setAuthToken(response.uppyAuthToken) - } finally { - this.#refreshingTokenPromise = undefined - } - })() + // only handle auth errors (401 from provider), and only handle them if we have a (refresh) token + if (!err.isAuthError || !(await this.#getAuthToken())) throw err + + if (this.#refreshingTokenPromise == null) { + // Many provider requests may be starting at once, however refresh token should only be called once. + // Once a refresh token operation has started, we need all other request to wait for this operation (atomically) + this.#refreshingTokenPromise = (async () => { + try { + const response = await super.request({ path: this.refreshTokenUrl(), method: 'POST' }) + await this.setAuthToken(response.uppyAuthToken) + } catch (refreshTokenErr) { + if (refreshTokenErr.isAuthError) { + // if refresh-token has failed with auth error, delete token, so we don't keep trying to refresh in future + await this.#removeAuthToken() + } + throw err + } finally { + this.#refreshingTokenPromise = undefined + } + })() + } await this.#refreshingTokenPromise From 559616e8be8b245714e7dc302df41c9d920e9185 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 25 Sep 2023 18:52:57 +0800 Subject: [PATCH 05/12] @uppy/companion: use deferred length for tus streams (#4697) use uploadLengthDeferred for streams with tus as recommended in https://github.com/tus/tus-js-client/pull/606 because sometimes HEAD reports an incorrect size --- packages/@uppy/companion/src/server/Uploader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/companion/src/server/Uploader.js b/packages/@uppy/companion/src/server/Uploader.js index 568efb780d..623319d31b 100644 --- a/packages/@uppy/companion/src/server/Uploader.js +++ b/packages/@uppy/companion/src/server/Uploader.js @@ -514,9 +514,9 @@ class Uploader { this.tus = new tus.Upload(stream, { endpoint: this.options.endpoint, uploadUrl: this.options.uploadUrl, - uploadLengthDeferred: false, + uploadLengthDeferred: !isFileStream, retryDelays: [0, 1000, 3000, 5000], - uploadSize: this.size, + uploadSize: isFileStream ? this.size : undefined, chunkSize, headers: headerSanitize(this.options.headers), addRequestId: true, From de4180c66167df1ac9fcb2318cba821a1244342f Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 25 Sep 2023 22:26:42 +0800 Subject: [PATCH 06/12] @uppy/companion: upgrade TS target (#4670) and fix ts error in tsconfig ("module") --- packages/@uppy/companion/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/companion/tsconfig.json b/packages/@uppy/companion/tsconfig.json index ecce73e0ee..cb42df19a1 100644 --- a/packages/@uppy/companion/tsconfig.json +++ b/packages/@uppy/companion/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "outDir": "./lib", - "module": "commonjs", + "module": "Node16", "moduleResolution": "node16", "declaration": true, - "target": "es6", + "target": "es2019", "noImplicitAny": false, "sourceMap": false, "allowJs": true, From 4ab1299696d9105b384bf7dbdd342f9658b05238 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 26 Sep 2023 22:18:33 +0800 Subject: [PATCH 07/12] run corepack yarn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit seems like it's gone out of sync: Run corepack yarn install --immutable ➤ YN0000: ┌ Resolution step Resolution step ➤ YN0000: └ Completed in 0s 979ms ➤ YN0000: ┌ Post-resolution validation Post-resolution validation ➤ YN0028: - svelte: ^4.0.0 ➤ YN0028: + svelte: ^3.0.0 || ^4.0.0 ➤ YN0028: The lockfile would have been modified by this install, which is explicitly forbidden. --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 45c17789fc..e8327ccb5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10030,7 +10030,7 @@ __metadata: "@uppy/drag-drop": "workspace:^" "@uppy/progress-bar": "workspace:^" "@uppy/status-bar": "workspace:^" - svelte: ^4.0.0 + svelte: ^3.0.0 || ^4.0.0 languageName: unknown linkType: soft From 2c432b12cd5f72fffbd485f70c38570837b6b242 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 26 Sep 2023 17:23:17 +0200 Subject: [PATCH 08/12] test: migrate to Vitest for Uppy core and Uppy plugins (#4700) --- ...ironment-jsdom-npm-29.5.0-fc600add1e.patch | 25 - package.json | 23 +- packages/@uppy/audio/package.json | 2 +- .../@uppy/audio/src/formatSeconds.test.js | 2 +- .../audio/src/supportsMediaRecorder.test.js | 2 +- packages/@uppy/aws-s3-multipart/package.json | 2 +- .../src/createSignedURL.test.js | 2 +- .../@uppy/aws-s3-multipart/src/index.test.js | 70 +- packages/@uppy/aws-s3/package.json | 2 +- packages/@uppy/aws-s3/src/index.test.js | 2 +- packages/@uppy/aws-s3/src/isXml.test.js | 2 +- packages/@uppy/companion-client/package.json | 2 +- .../src/RequestClient.test.js | 2 +- .../@uppy/companion-client/src/Socket.test.js | 14 +- packages/@uppy/compressor/package.json | 2 +- packages/@uppy/compressor/src/index.test.js | 6 +- packages/@uppy/core/package.json | 2 +- packages/@uppy/core/src/UIPlugin.test.js | 2 +- packages/@uppy/core/src/Uppy.test.js | 258 ++-- .../core/src/__snapshots__/Uppy.test.js.snap | 68 +- .../@uppy/core/src/mocks/acquirerPlugin1.js | 8 +- .../@uppy/core/src/mocks/acquirerPlugin2.js | 8 +- .../core/src/supportsUploadProgress.test.js | 2 +- packages/@uppy/dashboard/package.json | 4 +- packages/@uppy/dashboard/src/index.test.js | 2 +- .../src/utils/copyToClipboard.test.js | 4 +- .../src/utils/createSuperFocus.test.js | 2 +- packages/@uppy/remote-sources/package.json | 4 +- .../@uppy/remote-sources/src/index.test.js | 2 +- packages/@uppy/store-default/package.json | 2 +- .../@uppy/store-default/src/index.test.js | 2 +- packages/@uppy/store-redux/package.json | 4 +- packages/@uppy/store-redux/src/index.test.js | 2 +- .../@uppy/thumbnail-generator/package.json | 4 +- .../thumbnail-generator/src/index.test.js | 68 +- packages/@uppy/transloadit/package.json | 2 +- .../@uppy/transloadit/src/Assembly.test.js | 4 +- .../transloadit/src/AssemblyOptions.test.js | 2 +- packages/@uppy/transloadit/src/index.test.js | 2 +- packages/@uppy/tus/package.json | 2 +- packages/@uppy/tus/src/index.test.js | 2 +- packages/@uppy/utils/package.json | 2 +- .../@uppy/utils/src/AbortController.test.js | 8 +- .../@uppy/utils/src/ErrorWithCause.test.js | 2 +- .../@uppy/utils/src/RateLimitedQueue.test.js | 2 +- packages/@uppy/utils/src/Translator.test.js | 2 +- .../@uppy/utils/src/dataURItoBlob.test.js | 2 +- .../@uppy/utils/src/dataURItoFile.test.js | 2 +- packages/@uppy/utils/src/delay.test.js | 2 +- packages/@uppy/utils/src/emaFilter.test.js | 2 +- packages/@uppy/utils/src/findIndex.test.js | 2 +- .../@uppy/utils/src/generateFileID.test.js | 2 +- .../@uppy/utils/src/getBytesRemaining.test.js | 2 +- packages/@uppy/utils/src/getETA.test.js | 2 +- .../utils/src/getFileNameAndExtension.test.js | 2 +- packages/@uppy/utils/src/getFileType.test.js | 2 +- .../utils/src/getFileTypeExtension.test.js | 2 +- .../@uppy/utils/src/getSocketHost.test.js | 2 +- packages/@uppy/utils/src/getSpeed.test.js | 2 +- .../@uppy/utils/src/isMobileDevice.test.js | 2 +- .../@uppy/utils/src/isNetworkError.test.js | 2 +- packages/@uppy/utils/src/isObjectURL.test.js | 2 +- .../utils/src/isPreviewSupported.test.js | 2 +- .../@uppy/utils/src/isTouchDevice.test.js | 4 +- packages/@uppy/utils/src/prettyETA.test.js | 2 +- .../@uppy/utils/src/secondsToTime.test.js | 2 +- packages/@uppy/utils/src/settle.test.js | 2 +- packages/@uppy/utils/src/toArray.test.js | 2 +- .../@uppy/utils/src/truncateString.test.js | 2 +- packages/@uppy/webcam/package.json | 2 +- packages/@uppy/webcam/src/Webcam.test.js | 2 +- .../@uppy/webcam/src/formatSeconds.test.js | 2 +- .../webcam/src/supportsMediaRecorder.test.js | 2 +- packages/@uppy/xhr-upload/package.json | 4 +- packages/@uppy/xhr-upload/src/index.test.js | 6 +- private/test/globalSetup.mjs | 4 + vitest.config.ts | 14 + yarn.lock | 1079 ++++++++++++----- 78 files changed, 1144 insertions(+), 657 deletions(-) delete mode 100644 .yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch create mode 100644 private/test/globalSetup.mjs create mode 100644 vitest.config.ts diff --git a/.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch b/.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch deleted file mode 100644 index dd766ab1e9..0000000000 --- a/.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/build/index.js b/build/index.js -index ec8a133f3fbea56f4b395c96ca2b27bd4903c62e..dfd3852248f5008f82794ce61e3dca10ee8f8389 100644 ---- a/build/index.js -+++ b/build/index.js -@@ -49,7 +49,7 @@ class JSDOMEnvironment { - global; - errorEventListener; - moduleMocker; -- customExportConditions = ['browser']; -+ customExportConditions = ['jest','browser']; - constructor(config, context) { - const {projectConfig} = config; - const virtualConsole = new (_jsdom().VirtualConsole)(); -@@ -93,6 +93,11 @@ class JSDOMEnvironment { - // TODO: remove this ASAP, but it currently causes tests to run really slow - global.Buffer = Buffer; - -+ // JSDOM does not provide the following, thankfully Node.js ships with spec-compliant equivalent: -+ global.TextDecoder = TextDecoder; -+ global.TextEncoder = TextEncoder; -+ Object.defineProperty(global, 'crypto', {__proto__:null, value:require('node:crypto').webcrypto}); -+ - // Report uncaught errors. - this.errorEventListener = event => { - if (userErrorListenerCount === 0 && event.error != null) { diff --git a/package.json b/package.json index a752f892b1..cd91bcc182 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "adm-zip": "^0.5.5", "autoprefixer": "^10.2.6", "aws-sdk": "^2.1038.0", - "babel-jest": "^29.0.0", "babel-plugin-inline-package-json": "^2.0.0", "chalk": "^5.0.0", "concat-stream": "^2.0.0", @@ -80,8 +79,7 @@ "eslint-plugin-unicorn": "^46.0.0", "github-contributors-list": "^1.2.4", "glob": "^8.0.0", - "jest": "^29.0.0", - "jest-environment-jsdom": "^29.0.0", + "jsdom": "^22.1.0", "lint-staged": "^13.0.0", "mime-types": "^2.1.26", "nodemon": "^2.0.8", @@ -104,6 +102,7 @@ "tar": "^6.1.0", "tsd": "^0.22.0", "typescript": "~4.8", + "vitest": "^0.34.5", "vue-template-compiler": "workspace:*" }, "scripts": { @@ -143,8 +142,8 @@ "test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused", "test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings", "test:type": "yarn workspaces foreach -piv --include '@uppy/*' --exclude '@uppy/{angular,react-native,locales,companion,provider-views,robodog,svelte}' exec tsd", - "test:unit": "yarn run build:lib && NODE_OPTIONS=--experimental-vm-modules jest --env jsdom", - "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --env jsdom --watch --no-coverage", + "test:unit": "yarn run build:lib && yarn test:watch", + "test:watch": "vitest --environment jsdom --dir packages/@uppy", "test": "npm-run-all lint test:locale-packs:unused test:unit test:type test:companion", "uploadcdn": "yarn node ./bin/upload-to-cdn.js", "version": "yarn node ./bin/after-version-bump.js", @@ -154,24 +153,10 @@ "watch:js": "npm-run-all --parallel watch:js:bundle watch:js:lib", "watch": "npm-run-all --parallel watch:css watch:js" }, - "jest": { - "automock": false, - "collectCoverage": true, - "collectCoverageFrom": [ - "packages/**/src/**/*.js" - ], - "testMatch": [ - "**/packages/**/*.test.js" - ], - "testPathIgnorePatterns": [ - "/packages/@uppy/companion/" - ] - }, "resolutions": { "@types/eslint@^7.2.13": "^8.2.0", "@types/react": "^17", "@types/webpack-dev-server": "^4", - "jest-environment-jsdom": "patch:jest-environment-jsdom@npm:29.5.0#.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch", "pre-commit": "patch:pre-commit@npm:1.2.2#.yarn/patches/pre-commit-npm-1.2.2-f30af83877.patch", "preact": "patch:preact@npm:10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch", "start-server-and-test": "patch:start-server-and-test@npm:1.14.0#.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch", diff --git a/packages/@uppy/audio/package.json b/packages/@uppy/audio/package.json index 133647e0e8..2586da5b25 100644 --- a/packages/@uppy/audio/package.json +++ b/packages/@uppy/audio/package.json @@ -30,7 +30,7 @@ "preact": "^10.5.13" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/audio/src/formatSeconds.test.js b/packages/@uppy/audio/src/formatSeconds.test.js index e822ce8455..6ab1a4474f 100644 --- a/packages/@uppy/audio/src/formatSeconds.test.js +++ b/packages/@uppy/audio/src/formatSeconds.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import formatSeconds from './formatSeconds.js' describe('formatSeconds', () => { diff --git a/packages/@uppy/audio/src/supportsMediaRecorder.test.js b/packages/@uppy/audio/src/supportsMediaRecorder.test.js index cd735e8d73..71976cd98d 100644 --- a/packages/@uppy/audio/src/supportsMediaRecorder.test.js +++ b/packages/@uppy/audio/src/supportsMediaRecorder.test.js @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file */ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import supportsMediaRecorder from './supportsMediaRecorder.js' describe('supportsMediaRecorder', () => { diff --git a/packages/@uppy/aws-s3-multipart/package.json b/packages/@uppy/aws-s3-multipart/package.json index 2e4f09e7db..17eb9b1c48 100644 --- a/packages/@uppy/aws-s3-multipart/package.json +++ b/packages/@uppy/aws-s3-multipart/package.json @@ -30,8 +30,8 @@ "devDependencies": { "@aws-sdk/client-s3": "^3.362.0", "@aws-sdk/s3-request-presigner": "^3.362.0", - "@jest/globals": "^29.0.0", "nock": "^13.1.0", + "vitest": "^0.34.5", "whatwg-fetch": "3.6.2" }, "peerDependencies": { diff --git a/packages/@uppy/aws-s3-multipart/src/createSignedURL.test.js b/packages/@uppy/aws-s3-multipart/src/createSignedURL.test.js index 2d708d8aa5..cfcb12742c 100644 --- a/packages/@uppy/aws-s3-multipart/src/createSignedURL.test.js +++ b/packages/@uppy/aws-s3-multipart/src/createSignedURL.test.js @@ -1,4 +1,4 @@ -import { describe, it, beforeEach, afterEach } from '@jest/globals' +import { describe, it, beforeEach, afterEach } from 'vitest' import assert from 'node:assert' import { S3Client, UploadPartCommand, PutObjectCommand } from '@aws-sdk/client-s3' import { getSignedUrl } from '@aws-sdk/s3-request-presigner' diff --git a/packages/@uppy/aws-s3-multipart/src/index.test.js b/packages/@uppy/aws-s3-multipart/src/index.test.js index 07645f2538..e77afd346c 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.test.js +++ b/packages/@uppy/aws-s3-multipart/src/index.test.js @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, jest } from '@jest/globals' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import 'whatwg-fetch' import nock from 'nock' @@ -68,7 +68,7 @@ describe('AwsS3Multipart', () => { const fileSize = 1 core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -76,7 +76,7 @@ describe('AwsS3Multipart', () => { }), }) - const uploadSuccessHandler = jest.fn() + const uploadSuccessHandler = vi.fn() core.on('upload-success', uploadSuccessHandler) await core.upload() @@ -102,15 +102,15 @@ describe('AwsS3Multipart', () => { core = new Core() core.use(AwsS3Multipart, { limit: 0, - createMultipartUpload: jest.fn(() => { + createMultipartUpload: vi.fn(() => { return { uploadId: '6aeb1980f3fc7ce0b5454d25b71992', key: 'test/upload/multitest.dat', } }), - completeMultipartUpload: jest.fn(async () => ({ location: 'test' })), - abortMultipartUpload: jest.fn(), - prepareUploadParts: jest.fn(async (file, { parts }) => { + completeMultipartUpload: vi.fn(async () => ({ location: 'test' })), + abortMultipartUpload: vi.fn(), + prepareUploadParts: vi.fn(async (file, { parts }) => { const presignedUrls = {} parts.forEach(({ number }) => { presignedUrls[ @@ -156,7 +156,7 @@ describe('AwsS3Multipart', () => { .reply(200, '', { ETag: 'test2' }) core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -198,7 +198,7 @@ describe('AwsS3Multipart', () => { scope.persist() core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -270,13 +270,13 @@ describe('AwsS3Multipart', () => { let doneSpy awsS3Multipart.setOptions({ retryDelays: [10], - createMultipartUpload: jest.fn((file) => { + createMultipartUpload: vi.fn((file) => { const multipartUploader = awsS3Multipart.uploaders[file.id] const testChunkState = multipartUploader.chunkState[6] let busy = false let done = false - busySpy = jest.fn((value) => { busy = value }) - doneSpy = jest.fn((value) => { done = value }) + busySpy = vi.fn((value) => { busy = value }) + doneSpy = vi.fn((value) => { done = value }) Object.defineProperty(testChunkState, 'busy', { get: () => busy, set: busySpy }) Object.defineProperty(testChunkState, 'done', { get: () => done, set: doneSpy }) @@ -288,7 +288,7 @@ describe('AwsS3Multipart', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -316,29 +316,29 @@ describe('AwsS3Multipart', () => { }) describe('MultipartUploader', () => { - const createMultipartUpload = jest.fn(() => { + const createMultipartUpload = vi.fn(() => { return { uploadId: '6aeb1980f3fc7ce0b5454d25b71992', key: 'test/upload/multitest.dat', } }) - const signPart = jest + const signPart = vi .fn(async (file, { partNumber }) => { return { url: `https://bucket.s3.us-east-2.amazonaws.com/test/upload/multitest.dat?partNumber=${partNumber}&uploadId=6aeb1980f3fc7ce0b5454d25b71992&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIATEST%2F20210729%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20210729T014044Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=test` } }) - const uploadPartBytes = jest.fn() + const uploadPartBytes = vi.fn() - afterEach(() => jest.clearAllMocks()) + afterEach(() => vi.clearAllMocks()) it('retries uploadPartBytes when it fails once', async () => { const core = new Core() .use(AwsS3Multipart, { createMultipartUpload, - completeMultipartUpload: jest.fn(async () => ({ location: 'test' })), + completeMultipartUpload: vi.fn(async () => ({ location: 'test' })), // eslint-disable-next-line no-throw-literal - abortMultipartUpload: jest.fn(() => { throw 'should ignore' }), + abortMultipartUpload: vi.fn(() => { throw 'should ignore' }), signPart, uploadPartBytes: uploadPartBytes @@ -349,7 +349,7 @@ describe('AwsS3Multipart', () => { const fileSize = 5 * MB + 1 * MB core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -367,8 +367,8 @@ describe('AwsS3Multipart', () => { .use(AwsS3Multipart, { retryDelays: [10], createMultipartUpload, - completeMultipartUpload: jest.fn(async () => ({ location: 'test' })), - abortMultipartUpload: jest.fn(), + completeMultipartUpload: vi.fn(async () => ({ location: 'test' })), + abortMultipartUpload: vi.fn(), signPart, uploadPartBytes: uploadPartBytes // eslint-disable-next-line prefer-promise-reject-errors @@ -376,11 +376,11 @@ describe('AwsS3Multipart', () => { }) const awsS3Multipart = core.getPlugin('AwsS3Multipart') const fileSize = 5 * MB + 1 * MB - const mock = jest.fn() + const mock = vi.fn() core.on('upload-error', mock) core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -454,7 +454,7 @@ describe('AwsS3Multipart', () => { describe('file metadata across custom main functions', () => { let core - const createMultipartUpload = jest.fn(file => { + const createMultipartUpload = vi.fn(file => { core.setFileMeta(file.id, { ...file.meta, createMultipartUpload: true, @@ -466,7 +466,7 @@ describe('AwsS3Multipart', () => { } }) - const signPart = jest.fn((file, partData) => { + const signPart = vi.fn((file, partData) => { expect(file.meta.createMultipartUpload).toBe(true) core.setFileMeta(file.id, { @@ -480,7 +480,7 @@ describe('AwsS3Multipart', () => { } }) - const listParts = jest.fn((file) => { + const listParts = vi.fn((file) => { expect(file.meta.createMultipartUpload).toBe(true) core.setFileMeta(file.id, { ...file.meta, @@ -495,7 +495,7 @@ describe('AwsS3Multipart', () => { })) }) - const completeMultipartUpload = jest.fn((file) => { + const completeMultipartUpload = vi.fn((file) => { expect(file.meta.createMultipartUpload).toBe(true) expect(file.meta.signPart).toBe(true) for (let i = 1; i <= 10; i++) { @@ -504,7 +504,7 @@ describe('AwsS3Multipart', () => { return {} }) - const abortMultipartUpload = jest.fn((file) => { + const abortMultipartUpload = vi.fn((file) => { expect(file.meta.createMultipartUpload).toBe(true) expect(file.meta.signPart).toBe(true) expect(file.meta.abortingPart).toBe(5) @@ -542,7 +542,7 @@ describe('AwsS3Multipart', () => { const fileSize = 50 * MB core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -557,7 +557,7 @@ describe('AwsS3Multipart', () => { }) it('preserves file metadata if upload is aborted', async () => { - const signPartWithAbort = jest.fn((file, partData) => { + const signPartWithAbort = vi.fn((file, partData) => { expect(file.meta.createMultipartUpload).toBe(true) if (partData.partNumber === 5) { core.setFileMeta(file.id, { @@ -601,7 +601,7 @@ describe('AwsS3Multipart', () => { const fileSize = 50 * MB core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { @@ -616,7 +616,7 @@ describe('AwsS3Multipart', () => { }) it('preserves file metadata if upload is paused and resumed', async () => { - const completeMultipartUploadAfterPause = jest.fn((file) => { + const completeMultipartUploadAfterPause = vi.fn((file) => { expect(file.meta.createMultipartUpload).toBe(true) expect(file.meta.signPart).toBe(true) for (let i = 1; i <= 10; i++) { @@ -627,7 +627,7 @@ describe('AwsS3Multipart', () => { return {} }) - const signPartWithPause = jest.fn((file, partData) => { + const signPartWithPause = vi.fn((file, partData) => { expect(file.meta.createMultipartUpload).toBe(true) if (partData.partNumber === 3) { core.setFileMeta(file.id, { @@ -671,7 +671,7 @@ describe('AwsS3Multipart', () => { const fileSize = 50 * MB core.addFile({ - source: 'jest', + source: 'vi', name: 'multitest.dat', type: 'application/octet-stream', data: new File([new Uint8Array(fileSize)], { diff --git a/packages/@uppy/aws-s3/package.json b/packages/@uppy/aws-s3/package.json index 0cd91a24f6..6d3189eac5 100644 --- a/packages/@uppy/aws-s3/package.json +++ b/packages/@uppy/aws-s3/package.json @@ -30,7 +30,7 @@ "nanoid": "^4.0.0" }, "devDependencies": { - "@jest/globals": "^29.0.0", + "vitest": "^0.34.5", "whatwg-fetch": "3.6.2" }, "peerDependencies": { diff --git a/packages/@uppy/aws-s3/src/index.test.js b/packages/@uppy/aws-s3/src/index.test.js index b066f0d169..ecd10b3242 100644 --- a/packages/@uppy/aws-s3/src/index.test.js +++ b/packages/@uppy/aws-s3/src/index.test.js @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it } from '@jest/globals' +import { beforeEach, describe, expect, it } from 'vitest' import 'whatwg-fetch' import Core from '@uppy/core' import AwsS3 from './index.js' diff --git a/packages/@uppy/aws-s3/src/isXml.test.js b/packages/@uppy/aws-s3/src/isXml.test.js index e4490c4f00..f22515930e 100644 --- a/packages/@uppy/aws-s3/src/isXml.test.js +++ b/packages/@uppy/aws-s3/src/isXml.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import isXml from './isXml.js' describe('AwsS3', () => { diff --git a/packages/@uppy/companion-client/package.json b/packages/@uppy/companion-client/package.json index 4043629b5a..d484b979c2 100644 --- a/packages/@uppy/companion-client/package.json +++ b/packages/@uppy/companion-client/package.json @@ -26,6 +26,6 @@ "namespace-emitter": "^2.0.1" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/companion-client/src/RequestClient.test.js b/packages/@uppy/companion-client/src/RequestClient.test.js index 750809013b..b1817827c5 100644 --- a/packages/@uppy/companion-client/src/RequestClient.test.js +++ b/packages/@uppy/companion-client/src/RequestClient.test.js @@ -1,4 +1,4 @@ -import { describe, it, expect } from '@jest/globals' +import { describe, it, expect } from 'vitest' import RequestClient from './RequestClient.js' describe('RequestClient', () => { diff --git a/packages/@uppy/companion-client/src/Socket.test.js b/packages/@uppy/companion-client/src/Socket.test.js index 31dc8a6564..97e46dbd2a 100644 --- a/packages/@uppy/companion-client/src/Socket.test.js +++ b/packages/@uppy/companion-client/src/Socket.test.js @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, jest, describe, it, expect } from '@jest/globals' +import { afterEach, beforeEach, vi, describe, it, expect } from 'vitest' import UppySocket from './Socket.js' describe('Socket', () => { @@ -7,9 +7,9 @@ describe('Socket', () => { let webSocketSendSpy beforeEach(() => { - webSocketConstructorSpy = jest.fn() - webSocketCloseSpy = jest.fn() - webSocketSendSpy = jest.fn() + webSocketConstructorSpy = vi.fn() + webSocketCloseSpy = vi.fn() + webSocketSendSpy = vi.fn() globalThis.WebSocket = class WebSocket { constructor (target) { @@ -122,7 +122,7 @@ describe('Socket', () => { const uppySocket = new UppySocket({ target: 'foo' }) const webSocketInstance = uppySocket[Symbol.for('uppy test: getSocket')]() - const emitterListenerMock = jest.fn() + const emitterListenerMock = vi.fn() uppySocket.on('hi', emitterListenerMock) webSocketInstance.triggerOpen() @@ -137,7 +137,7 @@ describe('Socket', () => { it('should be able to emit messages and subscribe to them', () => { const uppySocket = new UppySocket({ target: 'foo' }) - const emitterListenerMock = jest.fn() + const emitterListenerMock = vi.fn() uppySocket.on('hi', emitterListenerMock) uppySocket.emit('hi', 'ho') @@ -161,7 +161,7 @@ describe('Socket', () => { it('should be able to subscribe to the first event for a particular action', () => { const uppySocket = new UppySocket({ target: 'foo' }) - const emitterListenerMock = jest.fn() + const emitterListenerMock = vi.fn() uppySocket.once('hi', emitterListenerMock) uppySocket.emit('hi', 'ho') diff --git a/packages/@uppy/compressor/package.json b/packages/@uppy/compressor/package.json index 57ceb8cbfe..96ea8b6ce5 100644 --- a/packages/@uppy/compressor/package.json +++ b/packages/@uppy/compressor/package.json @@ -36,6 +36,6 @@ "access": "public" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/compressor/src/index.test.js b/packages/@uppy/compressor/src/index.test.js index a172c524fc..6a67049933 100644 --- a/packages/@uppy/compressor/src/index.test.js +++ b/packages/@uppy/compressor/src/index.test.js @@ -1,7 +1,8 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Core from '@uppy/core' import getFileNameAndExtension from '@uppy/utils/lib/getFileNameAndExtension' import fs from 'node:fs' +import path from 'node:path' import CompressorPlugin from './index.js' // Compressor uses browser canvas API, so need to mock compress() @@ -14,7 +15,8 @@ CompressorPlugin.prototype.compress = (blob) => { } } -const sampleImage = fs.readFileSync(new URL('../../../../e2e/cypress/fixtures/images/image.jpg', import.meta.url)) +// eslint-disable-next-line no-restricted-globals +const sampleImage = fs.readFileSync(path.join(__dirname, '../../../../e2e/cypress/fixtures/images/image.jpg')) const file1 = { source: 'jest', name: 'image-1.jpeg', type: 'image/jpeg', data: new File([sampleImage], 'image-1.jpeg', { type: 'image/jpeg' }) } const file2 = { source: 'jest', name: 'yolo', type: 'image/jpeg', data: new File([sampleImage], 'yolo', { type: 'image/jpeg' }) } diff --git a/packages/@uppy/core/package.json b/packages/@uppy/core/package.json index 88d0cccb95..f11c3ac0b4 100644 --- a/packages/@uppy/core/package.json +++ b/packages/@uppy/core/package.json @@ -31,6 +31,6 @@ "preact": "^10.5.13" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/core/src/UIPlugin.test.js b/packages/@uppy/core/src/UIPlugin.test.js index 104c500cbe..a8ba16a127 100644 --- a/packages/@uppy/core/src/UIPlugin.test.js +++ b/packages/@uppy/core/src/UIPlugin.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import UIPlugin from './UIPlugin.js' import Core from './index.js' diff --git a/packages/@uppy/core/src/Uppy.test.js b/packages/@uppy/core/src/Uppy.test.js index 35ec8e66c3..6eb529ebd8 100644 --- a/packages/@uppy/core/src/Uppy.test.js +++ b/packages/@uppy/core/src/Uppy.test.js @@ -1,8 +1,9 @@ /* eslint no-console: "off", no-restricted-syntax: "off" */ -import { afterEach, beforeEach, describe, expect, it, jest, xit } from '@jest/globals' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import assert from 'node:assert' import fs from 'node:fs' +import path from 'node:path' import prettierBytes from '@transloadit/prettier-bytes' import Core from '../lib/index.js' import UIPlugin from '../lib/UIPlugin.js' @@ -14,12 +15,13 @@ import InvalidPluginWithoutId from './mocks/invalidPluginWithoutId.js' import InvalidPluginWithoutType from './mocks/invalidPluginWithoutType.js' import DeepFrozenStore from '../../../../e2e/cypress/fixtures/DeepFrozenStore.mjs' -const sampleImage = fs.readFileSync(new URL('../../../../e2e/cypress/fixtures/images/image.jpg', import.meta.url)) +// eslint-disable-next-line no-restricted-globals +const sampleImage = fs.readFileSync(path.join(__dirname, '../../../../e2e/cypress/fixtures/images/image.jpg')) describe('src/Core', () => { const RealCreateObjectUrl = globalThis.URL.createObjectURL beforeEach(() => { - globalThis.URL.createObjectURL = jest.fn().mockReturnValue('newUrl') + globalThis.URL.createObjectURL = vi.fn().mockReturnValue('newUrl') }) afterEach(() => { @@ -134,7 +136,7 @@ describe('src/Core', () => { it('should update the state', () => { const core = new Core() - const stateUpdateEventMock = jest.fn() + const stateUpdateEventMock = vi.fn() core.on('state-update', stateUpdateEventMock) core.use(AcquirerPlugin1) core.use(AcquirerPlugin2) @@ -210,9 +212,9 @@ describe('src/Core', () => { const core = new Core({ store: DeepFrozenStore(), }) - // const corePauseEventMock = jest.fn() - const coreCancelEventMock = jest.fn() - const coreStateUpdateEventMock = jest.fn() + // const corePauseEventMock = vi.fn() + const coreCancelEventMock = vi.fn() + const coreStateUpdateEventMock = vi.fn() core.on('cancel-all', coreCancelEventMock) core.on('state-update', coreStateUpdateEventMock) core.setState({ foo: 'bar', totalProgress: 30 }) @@ -240,14 +242,14 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -277,14 +279,14 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -314,14 +316,14 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -351,14 +353,14 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -383,8 +385,8 @@ describe('src/Core', () => { }) core.use(AcquirerPlugin1) - const coreCancelEventMock = jest.fn() - const coreStateUpdateEventMock = jest.fn() + const coreCancelEventMock = vi.fn() + const coreStateUpdateEventMock = vi.fn() const plugin = core[Symbol.for('uppy test: getPlugins')]('acquirer')[0] core.on('cancel-all', coreCancelEventMock) @@ -408,7 +410,7 @@ describe('src/Core', () => { }) expect(plugin.mocks.uninstall.mock.calls.length).toEqual(1) - const pluginIteration = jest.fn() + const pluginIteration = vi.fn() core.iteratePlugins(pluginIteration) expect(pluginIteration.mock.calls.length).toEqual(0) }) @@ -445,13 +447,13 @@ describe('src/Core', () => { it('should execute all the preprocessors when uploading a file', () => { const core = new Core() - const preprocessor1 = jest.fn() - const preprocessor2 = jest.fn() + const preprocessor1 = vi.fn() + const preprocessor2 = vi.fn() core.addPreProcessor(preprocessor1) core.addPreProcessor(preprocessor2) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -472,20 +474,20 @@ describe('src/Core', () => { it('should not pass removed file IDs to next step', async () => { const core = new Core() - const uploader = jest.fn() + const uploader = vi.fn() core.addPreProcessor((fileIDs) => { core.removeFile(fileIDs[0]) }) core.addUploader(uploader) core.addFile({ - source: 'jest', + source: 'vi', name: 'rmd.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'kept.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -501,7 +503,7 @@ describe('src/Core', () => { it('should update the file progress state when preprocess-progress event is fired', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -528,7 +530,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -563,13 +565,13 @@ describe('src/Core', () => { it('should execute all the postprocessors when uploading a file', () => { const core = new Core() - const postprocessor1 = jest.fn() - const postprocessor2 = jest.fn() + const postprocessor1 = vi.fn() + const postprocessor2 = vi.fn() core.addPostProcessor(postprocessor1) core.addPostProcessor(postprocessor2) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -597,7 +599,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -624,7 +626,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -650,7 +652,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -683,7 +685,7 @@ describe('src/Core', () => { describe('adding a file', () => { it('should call onBeforeFileAdded if it was specified in the options when initialising the class', () => { - const onBeforeFileAdded = jest.fn() + const onBeforeFileAdded = vi.fn() const core = new Core({ // need to capture a snapshot of files, because files will change in the next tick, thus failing the expect below @@ -691,7 +693,7 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -707,14 +709,14 @@ describe('src/Core', () => { const sameFileBlob = new File([sampleImage], { type: 'image/jpeg' }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: sameFileBlob, }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: sameFileBlob, @@ -723,12 +725,12 @@ describe('src/Core', () => { it('should add a file', () => { const fileData = new File([sampleImage], { type: 'image/jpeg' }) - const fileAddedEventMock = jest.fn() + const fileAddedEventMock = vi.fn() const core = new Core() core.on('file-added', fileAddedEventMock) const fileId = core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: fileData, @@ -750,7 +752,7 @@ describe('src/Core', () => { }, remote: '', size: 17175, - source: 'jest', + source: 'vi', type: 'image/jpeg', } expect(core.getFile(fileId)).toEqual(newFile) @@ -774,7 +776,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -783,7 +785,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.webm', type: 'video/webm; codecs="vp8, opus"', data: new File([sampleImage], { type: 'video/webm; codecs="vp8, opus"' }), @@ -795,14 +797,14 @@ describe('src/Core', () => { const core = new Core() const sameFileBlob = new File([sampleImage], { type: 'image/jpeg' }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: sameFileBlob, }) expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: sameFileBlob, @@ -819,13 +821,13 @@ describe('src/Core', () => { it('should allow a duplicate file if its relativePath is different, thus the id is different', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -839,7 +841,7 @@ describe('src/Core', () => { it('should not allow a file if onBeforeFileAdded returned false', () => { const core = new Core({ onBeforeFileAdded: (file) => { - if (file.source === 'jest') { + if (file.source === 'vi') { return false } return undefined @@ -847,7 +849,7 @@ describe('src/Core', () => { }) expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -862,7 +864,7 @@ describe('src/Core', () => { it('allows no new files after upload', async () => { const core = new Core({ allowMultipleUploadBatches: false }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -872,7 +874,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: '123.foo', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -885,7 +887,7 @@ describe('src/Core', () => { it('allows no new files after upload with legacy allowMultipleUploads option', async () => { const core = new Core({ allowMultipleUploads: false }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -895,7 +897,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: '123.foo', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -910,13 +912,13 @@ describe('src/Core', () => { // adding 2 files const fileId1 = core.addFile({ - source: 'jest', + source: 'vi', name: '1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: '2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -933,13 +935,13 @@ describe('src/Core', () => { // adding 2 files const fileId1 = core.addFile({ - source: 'jest', + source: 'vi', name: '1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) const fileId2 = core.addFile({ - source: 'jest', + source: 'vi', name: '2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -959,13 +961,13 @@ describe('src/Core', () => { data.lastModified = 1562770350937 core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data, }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo푸.jpg', type: 'image/jpeg', data, @@ -982,8 +984,8 @@ describe('src/Core', () => { const core = new Core() core.addUploader(() => Promise.resolve()) - core.addFile({ source: 'jest', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) - core.addFile({ source: 'jest', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) return expect(core.upload()).resolves.toMatchObject({ successful: [ @@ -1009,8 +1011,8 @@ describe('src/Core', () => { return Promise.resolve() }) - core.addFile({ source: 'jest', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) - core.addFile({ source: 'jest', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) return expect(core.upload()).resolves.toMatchObject({ successful: [ @@ -1034,8 +1036,8 @@ describe('src/Core', () => { } core.addUploader(() => Promise.resolve()) - core.addFile({ source: 'jest', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) - core.addFile({ source: 'jest', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new Uint8Array() }) + core.addFile({ source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() }) core.addFile({ source: 'file3', name: 'file3.jpg', type: 'image/jpeg', data: new Uint8Array() }) // uploadID is random, we don't want randomness in the snapshot @@ -1058,19 +1060,19 @@ describe('src/Core', () => { }, }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: '123.foo', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1083,13 +1085,13 @@ describe('src/Core', () => { it('only allows a single upload() batch when allowMultipleUploadBatches: false', async () => { const core = new Core({ allowMultipleUploadBatches: false }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1105,7 +1107,7 @@ describe('src/Core', () => { const core = new Core({ allowMultipleUploadBatches: false }) core.addFile({ - source: 'jest', + source: 'vi', name: 'bar.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1115,7 +1117,7 @@ describe('src/Core', () => { core.cancelAll() core.addFile({ - source: 'jest', + source: 'vi', name: '123.foo', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1126,13 +1128,13 @@ describe('src/Core', () => { describe('removing a file', () => { it('should remove the file', () => { - const fileRemovedEventMock = jest.fn() + const fileRemovedEventMock = vi.fn() const core = new Core() core.on('file-removed', fileRemovedEventMock) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1155,15 +1157,15 @@ describe('src/Core', () => { describe('retries', () => { it('should start a new upload with failed files', async () => { - const onUpload = jest.fn() - const onRetryAll = jest.fn() + const onUpload = vi.fn() + const onRetryAll = vi.fn() const core = new Core() core.on('upload', onUpload) core.on('retry-all', onRetryAll) const id = core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1178,13 +1180,13 @@ describe('src/Core', () => { }) it('should not start a new upload if there are no failed files', async () => { - const onUpload = jest.fn() + const onUpload = vi.fn() const core = new Core() core.on('upload', onUpload) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1196,9 +1198,9 @@ describe('src/Core', () => { }) describe('restoring a file', () => { - xit('should restore a file', () => { }) + it.skip('should restore a file', () => { }) - xit("should fail to restore a file if it doesn't exist", () => { }) + it.skip("should fail to restore a file if it doesn't exist", () => { }) }) describe('get a file', () => { @@ -1206,7 +1208,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1230,13 +1232,13 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'empty.dat', type: 'application/octet-stream', data: new File([new Uint8Array(1000)], { type: 'application/octet-stream' }), @@ -1309,7 +1311,7 @@ describe('src/Core', () => { try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.png', type: 'image/png', data: new File([sampleImage], { type: 'image/png' }), @@ -1328,7 +1330,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.png', type: 'image/png', data: new File([sampleImage], { type: 'image/png' }), @@ -1360,7 +1362,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1383,7 +1385,7 @@ describe('src/Core', () => { meta: { foo2: 'bar2' }, }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', meta: { @@ -1406,7 +1408,7 @@ describe('src/Core', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1558,13 +1560,13 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1591,18 +1593,18 @@ describe('src/Core', () => { }) it('should reset the progress', () => { - const resetProgressEvent = jest.fn() + const resetProgressEvent = vi.fn() const core = new Core() core.on('reset-progress', resetProgressEvent) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1662,14 +1664,14 @@ describe('src/Core', () => { // add 2 files core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), }) try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1691,7 +1693,7 @@ describe('src/Core', () => { expect(() => { // add 1 ghost file const fileId1 = core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1700,7 +1702,7 @@ describe('src/Core', () => { // add another file core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1708,7 +1710,7 @@ describe('src/Core', () => { }).not.toThrowError() }) - xit('should enforce the minNumberOfFiles rule', () => { }) + it.skip('should enforce the minNumberOfFiles rule', () => { }) it('should enforce the allowedFileTypes rule', () => { const core = new Core({ @@ -1719,7 +1721,7 @@ describe('src/Core', () => { try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1753,7 +1755,7 @@ describe('src/Core', () => { try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.png', type: '', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1765,7 +1767,7 @@ describe('src/Core', () => { } expect(() => core.addFile({ - source: 'jest', + source: 'vi', name: 'foo2.JPG', type: '', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1781,7 +1783,7 @@ describe('src/Core', () => { try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1802,7 +1804,7 @@ describe('src/Core', () => { try { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1822,7 +1824,7 @@ describe('src/Core', () => { }) core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1830,7 +1832,7 @@ describe('src/Core', () => { expect(() => { core.addFile({ - source: 'jest', + source: 'vi', name: 'foo1.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -1854,7 +1856,7 @@ describe('src/Core', () => { }) const newFile = { - source: 'jest', + source: 'vi', name: 'foo1.jpg', extension: 'jpg', type: 'image/jpeg', @@ -1879,7 +1881,7 @@ describe('src/Core', () => { maxFileSize, }, }) - const restrictionsViolatedEventMock = jest.fn() + const restrictionsViolatedEventMock = vi.fn() const file = { name: 'test.jpg', data: new Blob([new Uint8Array(2 * maxFileSize)]), @@ -1950,9 +1952,9 @@ describe('src/Core', () => { }) it('should emit the correct event based on whether there is a network connection', () => { - const onlineEventMock = jest.fn() - const offlineEventMock = jest.fn() - const backOnlineEventMock = jest.fn() + const onlineEventMock = vi.fn() + const offlineEventMock = vi.fn() + const backOnlineEventMock = vi.fn() const core = new Core() core.on('is-offline', offlineEventMock) core.on('is-online', onlineEventMock) @@ -1980,7 +1982,7 @@ describe('src/Core', () => { describe('info', () => { it('should set a string based message to be displayed infinitely', () => { - const infoVisibleEvent = jest.fn() + const infoVisibleEvent = vi.fn() const core = new Core() core.on('info-visible', infoVisibleEvent) @@ -1994,7 +1996,7 @@ describe('src/Core', () => { }) it('should set a object based message to be displayed infinitely', () => { - const infoVisibleEvent = jest.fn() + const infoVisibleEvent = vi.fn() const core = new Core() core.on('info-visible', infoVisibleEvent) @@ -2015,8 +2017,8 @@ describe('src/Core', () => { }) it('should set an info message to be displayed for a period of time before hiding', (done) => { - const infoVisibleEvent = jest.fn() - const infoHiddenEvent = jest.fn() + const infoVisibleEvent = vi.fn() + const infoHiddenEvent = vi.fn() const core = new Core() core.on('info-visible', infoVisibleEvent) core.on('info-hidden', infoHiddenEvent) @@ -2031,8 +2033,8 @@ describe('src/Core', () => { }) it('should hide an info message', () => { - const infoVisibleEvent = jest.fn() - const infoHiddenEvent = jest.fn() + const infoVisibleEvent = vi.fn() + const infoHiddenEvent = vi.fn() const core = new Core() core.on('info-visible', infoVisibleEvent) core.on('info-hidden', infoHiddenEvent) @@ -2045,8 +2047,8 @@ describe('src/Core', () => { }) it('should support multiple messages', () => { - const infoVisibleEvent = jest.fn() - const infoHiddenEvent = jest.fn() + const infoVisibleEvent = vi.fn() + const infoHiddenEvent = vi.fn() const core = new Core() core.on('info-visible', infoVisibleEvent) @@ -2089,7 +2091,7 @@ describe('src/Core', () => { it('should assign the specified files to a new upload', () => { const core = new Core() core.addFile({ - source: 'jest', + source: 'vi', name: 'foo.jpg', type: 'image/jpeg', data: new File([sampleImage], { type: 'image/jpeg' }), @@ -2138,9 +2140,9 @@ describe('src/Core', () => { describe('log', () => { it('should log via provided logger function', () => { const myTestLogger = { - debug: jest.fn(), - warn: jest.fn(), - error: jest.fn(), + debug: vi.fn(), + warn: vi.fn(), + error: vi.fn(), } const core = new Core({ @@ -2161,9 +2163,9 @@ describe('src/Core', () => { it('should log via provided logger function, even if debug: true', () => { const myTestLogger = { - debug: jest.fn(), - warn: jest.fn(), - error: jest.fn(), + debug: vi.fn(), + warn: vi.fn(), + error: vi.fn(), } const core = new Core({ @@ -2186,8 +2188,8 @@ describe('src/Core', () => { }) it('should log to console when logger: Uppy.debugLogger or debug: true is set', () => { - console.debug = jest.fn() - console.error = jest.fn() + console.debug = vi.fn() + console.error = vi.fn() const core = new Core({ logger: debugLogger, @@ -2220,8 +2222,8 @@ describe('src/Core', () => { }) it('should only log errors to console when logger is not set', () => { - console.debug = jest.fn() - console.error = jest.fn() + console.debug = vi.fn() + console.error = vi.fn() const core = new Core() diff --git a/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap b/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap index c3283adf56..749990b6e4 100644 --- a/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap +++ b/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap @@ -1,4 +1,70 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`src/Core > plugins > should not be able to add a plugin that has no id 1`] = `"Your plugin must have an id"`; + +exports[`src/Core > plugins > should not be able to add a plugin that has no type 1`] = `"Your plugin must have a type"`; + +exports[`src/Core > plugins > should not be able to add an invalid plugin 1`] = `"Expected a plugin class, but got object. Please verify that the plugin was imported and spelled correctly."`; + +exports[`src/Core > plugins > should prevent the same plugin from being added more than once 1`] = ` +"Already found a plugin named 'TestSelector1'. Tried to use: 'TestSelector1'. +Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id." +`; + +exports[`src/Core > uploading a file > should only upload files that are not already assigned to another upload id 1`] = ` +{ + "failed": [], + "successful": [ + { + "data": Uint8Array [], + "extension": "jpg", + "id": "uppy-foo/jpg-1e-image/jpeg", + "isRemote": false, + "meta": { + "name": "foo.jpg", + "type": "image/jpeg", + }, + "name": "foo.jpg", + "preview": undefined, + "progress": { + "bytesTotal": null, + "bytesUploaded": 0, + "percentage": 0, + "uploadComplete": false, + "uploadStarted": null, + }, + "remote": "", + "size": null, + "source": "vi", + "type": "image/jpeg", + }, + { + "data": Uint8Array [], + "extension": "jpg", + "id": "uppy-bar/jpg-1e-image/jpeg", + "isRemote": false, + "meta": { + "name": "bar.jpg", + "type": "image/jpeg", + }, + "name": "bar.jpg", + "preview": undefined, + "progress": { + "bytesTotal": null, + "bytesUploaded": 0, + "percentage": 0, + "uploadComplete": false, + "uploadStarted": null, + }, + "remote": "", + "size": null, + "source": "vi", + "type": "image/jpeg", + }, + ], + "uploadID": "cjd09qwxb000dlql4tp4doz8h", +} +`; exports[`src/Core plugins should not be able to add a plugin that has no id 1`] = `"Your plugin must have an id"`; diff --git a/packages/@uppy/core/src/mocks/acquirerPlugin1.js b/packages/@uppy/core/src/mocks/acquirerPlugin1.js index 51be842a9f..6a0b93363b 100644 --- a/packages/@uppy/core/src/mocks/acquirerPlugin1.js +++ b/packages/@uppy/core/src/mocks/acquirerPlugin1.js @@ -1,4 +1,4 @@ -import { jest } from '@jest/globals' // eslint-disable-line import/no-extraneous-dependencies +import { vi } from 'vitest' // eslint-disable-line import/no-extraneous-dependencies import UIPlugin from '../UIPlugin.js' export default class TestSelector1 extends UIPlugin { @@ -9,9 +9,9 @@ export default class TestSelector1 extends UIPlugin { this.name = this.constructor.name this.mocks = { - run: jest.fn(), - update: jest.fn(), - uninstall: jest.fn(), + run: vi.fn(), + update: vi.fn(), + uninstall: vi.fn(), } } diff --git a/packages/@uppy/core/src/mocks/acquirerPlugin2.js b/packages/@uppy/core/src/mocks/acquirerPlugin2.js index f277336f24..0968dd7fb7 100644 --- a/packages/@uppy/core/src/mocks/acquirerPlugin2.js +++ b/packages/@uppy/core/src/mocks/acquirerPlugin2.js @@ -1,4 +1,4 @@ -import { jest } from '@jest/globals' // eslint-disable-line import/no-extraneous-dependencies +import { vi } from 'vitest' // eslint-disable-line import/no-extraneous-dependencies import UIPlugin from '../UIPlugin.js' export default class TestSelector2 extends UIPlugin { @@ -9,9 +9,9 @@ export default class TestSelector2 extends UIPlugin { this.name = this.constructor.name this.mocks = { - run: jest.fn(), - update: jest.fn(), - uninstall: jest.fn(), + run: vi.fn(), + update: vi.fn(), + uninstall: vi.fn(), } } diff --git a/packages/@uppy/core/src/supportsUploadProgress.test.js b/packages/@uppy/core/src/supportsUploadProgress.test.js index 746e038936..1c6000d6f3 100644 --- a/packages/@uppy/core/src/supportsUploadProgress.test.js +++ b/packages/@uppy/core/src/supportsUploadProgress.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import supportsUploadProgress from './supportsUploadProgress.js' describe('supportsUploadProgress', () => { diff --git a/packages/@uppy/dashboard/package.json b/packages/@uppy/dashboard/package.json index 4c48155a8d..7306b33852 100644 --- a/packages/@uppy/dashboard/package.json +++ b/packages/@uppy/dashboard/package.json @@ -37,10 +37,10 @@ "preact": "^10.5.13" }, "devDependencies": { - "@jest/globals": "^29.0.0", "@uppy/google-drive": "workspace:^", "@uppy/status-bar": "workspace:^", - "resize-observer-polyfill": "^1.5.0" + "resize-observer-polyfill": "^1.5.0", + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/dashboard/src/index.test.js b/packages/@uppy/dashboard/src/index.test.js index 0760fa0498..155742d990 100644 --- a/packages/@uppy/dashboard/src/index.test.js +++ b/packages/@uppy/dashboard/src/index.test.js @@ -1,4 +1,4 @@ -import { afterAll, beforeAll, describe, it, expect } from '@jest/globals' +import { afterAll, beforeAll, describe, it, expect } from 'vitest' import Core from '@uppy/core' import StatusBarPlugin from '@uppy/status-bar' diff --git a/packages/@uppy/dashboard/src/utils/copyToClipboard.test.js b/packages/@uppy/dashboard/src/utils/copyToClipboard.test.js index f77c972e59..328ee49588 100644 --- a/packages/@uppy/dashboard/src/utils/copyToClipboard.test.js +++ b/packages/@uppy/dashboard/src/utils/copyToClipboard.test.js @@ -1,8 +1,8 @@ -import { describe, xit, expect } from '@jest/globals' +import { describe, it, expect } from 'vitest' import copyToClipboard from './copyToClipboard.js' describe('copyToClipboard', () => { - xit('should copy the specified text to the clipboard', () => { + it.skip('should copy the specified text to the clipboard', () => { expect(typeof copyToClipboard).toBe('function') }) }) diff --git a/packages/@uppy/dashboard/src/utils/createSuperFocus.test.js b/packages/@uppy/dashboard/src/utils/createSuperFocus.test.js index bcebfac49f..f30f1bc22d 100644 --- a/packages/@uppy/dashboard/src/utils/createSuperFocus.test.js +++ b/packages/@uppy/dashboard/src/utils/createSuperFocus.test.js @@ -1,4 +1,4 @@ -import { describe, it, expect } from '@jest/globals' +import { describe, it, expect } from 'vitest' import createSuperFocus from './createSuperFocus.js' describe('createSuperFocus', () => { diff --git a/packages/@uppy/remote-sources/package.json b/packages/@uppy/remote-sources/package.json index 04ef6ce2dc..e358b0334e 100644 --- a/packages/@uppy/remote-sources/package.json +++ b/packages/@uppy/remote-sources/package.json @@ -45,7 +45,7 @@ "access": "public" }, "devDependencies": { - "@jest/globals": "^29.0.0", - "resize-observer-polyfill": "^1.5.1" + "resize-observer-polyfill": "^1.5.1", + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/remote-sources/src/index.test.js b/packages/@uppy/remote-sources/src/index.test.js index 7af4414785..aecae499ed 100644 --- a/packages/@uppy/remote-sources/src/index.test.js +++ b/packages/@uppy/remote-sources/src/index.test.js @@ -1,4 +1,4 @@ -import { afterAll, beforeAll, describe, expect, it } from '@jest/globals' +import { afterAll, beforeAll, describe, expect, it } from 'vitest' import resizeObserverPolyfill from 'resize-observer-polyfill' import Core from '@uppy/core' import Dashboard from '@uppy/dashboard' diff --git a/packages/@uppy/store-default/package.json b/packages/@uppy/store-default/package.json index beec06cf71..aab331b252 100644 --- a/packages/@uppy/store-default/package.json +++ b/packages/@uppy/store-default/package.json @@ -16,7 +16,7 @@ "url": "https://github.com/transloadit/uppy/issues" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" }, "repository": { "type": "git", diff --git a/packages/@uppy/store-default/src/index.test.js b/packages/@uppy/store-default/src/index.test.js index 92e458f284..d943c4f041 100644 --- a/packages/@uppy/store-default/src/index.test.js +++ b/packages/@uppy/store-default/src/index.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import assert from 'node:assert' import DefaultStore from './index.js' diff --git a/packages/@uppy/store-redux/package.json b/packages/@uppy/store-redux/package.json index fe413fce67..ea78813494 100644 --- a/packages/@uppy/store-redux/package.json +++ b/packages/@uppy/store-redux/package.json @@ -24,7 +24,7 @@ "nanoid": "^4.0.0" }, "devDependencies": { - "@jest/globals": "^29.0.0", - "redux": "^4.0.0" + "redux": "^4.0.0", + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/store-redux/src/index.test.js b/packages/@uppy/store-redux/src/index.test.js index 2ec5c2eba5..9b36a602f8 100644 --- a/packages/@uppy/store-redux/src/index.test.js +++ b/packages/@uppy/store-redux/src/index.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Redux from 'redux' import { ReduxStore, reducer } from './index.js' diff --git a/packages/@uppy/thumbnail-generator/package.json b/packages/@uppy/thumbnail-generator/package.json index 848805bd90..95122f5190 100644 --- a/packages/@uppy/thumbnail-generator/package.json +++ b/packages/@uppy/thumbnail-generator/package.json @@ -27,8 +27,8 @@ "exifr": "^7.0.0" }, "devDependencies": { - "@jest/globals": "^29.0.0", - "namespace-emitter": "2.0.1" + "namespace-emitter": "2.0.1", + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/thumbnail-generator/src/index.test.js b/packages/@uppy/thumbnail-generator/src/index.test.js index 3eb8928b48..05e414a62c 100644 --- a/packages/@uppy/thumbnail-generator/src/index.test.js +++ b/packages/@uppy/thumbnail-generator/src/index.test.js @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, it, expect, jest, xit } from '@jest/globals' +import { afterEach, beforeEach, describe, it, expect, vi } from 'vitest' import { UIPlugin } from '@uppy/core' import emitter from 'namespace-emitter' import ThumbnailGeneratorPlugin from './index.js' @@ -45,11 +45,11 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { describe('install', () => { it('should subscribe to uppy file-added event', () => { const core = Object.assign(new MockCore(), { - on: jest.fn(), + on: vi.fn(), }) const plugin = new ThumbnailGeneratorPlugin(core) - plugin.addToQueue = jest.fn() + plugin.addToQueue = vi.fn() plugin.install() expect(core.on).toHaveBeenCalledTimes(4) @@ -60,12 +60,12 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { describe('uninstall', () => { it('should unsubscribe from uppy file-added event', () => { const core = Object.assign(new MockCore(), { - on: jest.fn(), - off: jest.fn(), + on: vi.fn(), + off: vi.fn(), }) const plugin = new ThumbnailGeneratorPlugin(core) - plugin.addToQueue = jest.fn() + plugin.addToQueue = vi.fn() plugin.install() expect(core.on).toHaveBeenCalledTimes(4) @@ -81,7 +81,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { it('should add a new file to the queue and start processing the queue when queueProcessing is false', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.processQueue = jest.fn() + plugin.processQueue = vi.fn() const file = { id: 'bar', type: 'image/jpeg' } plugin.queueProcessing = false @@ -99,7 +99,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { it('should process items in the queue one by one', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.requestThumbnail = jest.fn(() => delay(100)) + plugin.requestThumbnail = vi.fn(() => delay(100)) plugin.install() const file1 = { id: 'bar', type: 'image/jpeg', data: new Blob() } @@ -137,17 +137,17 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { const plugin = new ThumbnailGeneratorPlugin(core) plugin.install() - URL.revokeObjectURL = jest.fn(() => null) + URL.revokeObjectURL = vi.fn(() => null) try { const file1 = { id: 1, name: 'bar.jpg', type: 'image/jpeg', data: new Blob() } const file2 = { id: 2, name: 'bar2.jpg', type: 'image/jpeg', data: new Blob() } - plugin.createThumbnail = jest.fn(async () => { + plugin.createThumbnail = vi.fn(async () => { await delay(50) return 'blob:http://uppy.io/fake-thumbnail' }) - plugin.setPreviewURL = jest.fn((id, preview) => { + plugin.setPreviewURL = vi.fn((id, preview) => { if (id === 1) file1.preview = preview if (id === 2) file2.preview = preview }) @@ -177,8 +177,8 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { describe('events', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.createThumbnail = jest.fn((file) => delay(100).then(() => `blob:${file.id}.png`)) - plugin.setPreviewURL = jest.fn() + plugin.createThumbnail = vi.fn((file) => delay(100).then(() => `blob:${file.id}.png`)) + plugin.setPreviewURL = vi.fn() plugin.install() function add (file) { @@ -219,10 +219,10 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.createThumbnail = jest + plugin.createThumbnail = vi .fn() .mockReturnValue(Promise.resolve('preview')) - plugin.setPreviewURL = jest.fn() + plugin.setPreviewURL = vi.fn() const file = { id: 'file1', type: 'image/png', isRemote: false } return plugin.requestThumbnail(file).then(() => { @@ -239,10 +239,10 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.createThumbnail = jest + plugin.createThumbnail = vi .fn() .mockReturnValue(Promise.resolve('preview')) - plugin.setPreviewURL = jest.fn() + plugin.setPreviewURL = vi.fn() const file = { id: 'file1', type: 'text/html', isRemote: false } return plugin.requestThumbnail(file).then(() => { @@ -254,10 +254,10 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.createThumbnail = jest + plugin.createThumbnail = vi .fn() .mockReturnValue(Promise.resolve('preview')) - plugin.setPreviewURL = jest.fn() + plugin.setPreviewURL = vi.fn() const file = { id: 'file1', type: 'image/png', isRemote: true } return plugin.requestThumbnail(file).then(() => { @@ -269,10 +269,10 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) - plugin.createThumbnail = jest + plugin.createThumbnail = vi .fn() .mockReturnValue(Promise.resolve('preview')) - plugin.setPreviewURL = jest.fn() + plugin.setPreviewURL = vi.fn() const file = { id: 'file1', type: 'image/png', isRemote: false } return plugin.requestThumbnail(file).then(() => { @@ -295,7 +295,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { }, }, }, - setFileState: jest.fn(), + setFileState: vi.fn(), plugins: {}, } core.state = { @@ -362,7 +362,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { URL.createObjectURL = originalURLCreateObjectURL }) - xit('should scale down the image by the specified number of steps', () => { + it.skip('should scale down the image by the specified number of steps', () => { const core = new MockCore() const plugin = new ThumbnailGeneratorPlugin(core) const image = { @@ -370,14 +370,14 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { height: 800, } const context = { - drawImage: jest.fn(), + drawImage: vi.fn(), } const canvas = { width: 0, height: 0, - getContext: jest.fn().mockReturnValue(context), + getContext: vi.fn().mockReturnValue(context), } - document.createElement = jest.fn().mockReturnValue(canvas) + document.createElement = vi.fn().mockReturnValue(canvas) const result = plugin.downScaleInSteps(image, 3) const newImage = { getContext: canvas.getContext, @@ -427,14 +427,14 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { height: 800, } const context = { - drawImage: jest.fn(), + drawImage: vi.fn(), } const canvas = { width: 0, height: 0, - getContext: jest.fn().mockReturnValue(context), + getContext: vi.fn().mockReturnValue(context), } - document.createElement = jest.fn().mockReturnValue(canvas) + document.createElement = vi.fn().mockReturnValue(canvas) const result = plugin.resizeImage(image, 200, 160) expect(result).toEqual({ @@ -452,14 +452,14 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { height: 80, } const context = { - drawImage: jest.fn(), + drawImage: vi.fn(), } const canvas = { width: 0, height: 0, - getContext: jest.fn().mockReturnValue(context), + getContext: vi.fn().mockReturnValue(context), } - document.createElement = jest.fn().mockReturnValue(canvas) + document.createElement = vi.fn().mockReturnValue(canvas) const result = plugin.resizeImage(image, 200, 160) expect(result).toEqual({ @@ -490,7 +490,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { }) const plugin = new ThumbnailGeneratorPlugin(core) - plugin.addToQueue = jest.fn() + plugin.addToQueue = vi.fn() plugin.install() core.emit('restored') @@ -517,7 +517,7 @@ describe('uploader/ThumbnailGeneratorPlugin', () => { }) const plugin = new ThumbnailGeneratorPlugin(core) - plugin.addToQueue = jest.fn() + plugin.addToQueue = vi.fn() plugin.install() core.emit('restored') diff --git a/packages/@uppy/transloadit/package.json b/packages/@uppy/transloadit/package.json index a58f4ea801..2abe161260 100644 --- a/packages/@uppy/transloadit/package.json +++ b/packages/@uppy/transloadit/package.json @@ -38,7 +38,7 @@ "@uppy/core": "workspace:^" }, "devDependencies": { - "@jest/globals": "^29.0.0", + "vitest": "^0.34.5", "whatwg-fetch": "^3.6.2" } } diff --git a/packages/@uppy/transloadit/src/Assembly.test.js b/packages/@uppy/transloadit/src/Assembly.test.js index b1515ab450..e463757779 100644 --- a/packages/@uppy/transloadit/src/Assembly.test.js +++ b/packages/@uppy/transloadit/src/Assembly.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it, jest } from '@jest/globals' +import { describe, expect, it, vi } from 'vitest' import { RateLimitedQueue } from '@uppy/utils/lib/RateLimitedQueue' import Assembly from './Assembly.js' @@ -7,7 +7,7 @@ describe('Transloadit/Assembly', () => { function attemptDiff (prev, next) { const assembly = new Assembly(prev, new RateLimitedQueue()) const events = [] - assembly.emit = jest.fn((name, ...args) => { + assembly.emit = vi.fn((name, ...args) => { events.push([name, ...args]) }) diff --git a/packages/@uppy/transloadit/src/AssemblyOptions.test.js b/packages/@uppy/transloadit/src/AssemblyOptions.test.js index 98b180d17e..df75684373 100644 --- a/packages/@uppy/transloadit/src/AssemblyOptions.test.js +++ b/packages/@uppy/transloadit/src/AssemblyOptions.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import AssemblyOptions from './AssemblyOptions.js' describe('Transloadit/AssemblyOptions', () => { diff --git a/packages/@uppy/transloadit/src/index.test.js b/packages/@uppy/transloadit/src/index.test.js index fb8b6c75f8..716ad93267 100644 --- a/packages/@uppy/transloadit/src/index.test.js +++ b/packages/@uppy/transloadit/src/index.test.js @@ -1,6 +1,6 @@ import { createServer } from 'node:http' import { once } from 'node:events' -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Core from '@uppy/core' import Transloadit from './index.js' import 'whatwg-fetch' diff --git a/packages/@uppy/tus/package.json b/packages/@uppy/tus/package.json index 27edf835f2..f542531cd2 100644 --- a/packages/@uppy/tus/package.json +++ b/packages/@uppy/tus/package.json @@ -28,7 +28,7 @@ "tus-js-client": "^3.0.0" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/tus/src/index.test.js b/packages/@uppy/tus/src/index.test.js index 4ac3aa3634..75eda875f6 100644 --- a/packages/@uppy/tus/src/index.test.js +++ b/packages/@uppy/tus/src/index.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Core from '@uppy/core' import Tus from './index.js' diff --git a/packages/@uppy/utils/package.json b/packages/@uppy/utils/package.json index ebbd9722b1..6a7a938b41 100644 --- a/packages/@uppy/utils/package.json +++ b/packages/@uppy/utils/package.json @@ -72,6 +72,6 @@ "preact": "^10.5.13" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" } } diff --git a/packages/@uppy/utils/src/AbortController.test.js b/packages/@uppy/utils/src/AbortController.test.js index b507892a1c..b5f323532e 100644 --- a/packages/@uppy/utils/src/AbortController.test.js +++ b/packages/@uppy/utils/src/AbortController.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it, jest } from '@jest/globals' +import { describe, expect, it, vi } from 'vitest' import { AbortController, AbortSignal } from './AbortController.js' function flushInstantTimeouts () { @@ -14,7 +14,7 @@ describe('AbortController', () => { it('emits "abort" when abort() is called', async () => { const controller = new AbortController() - const callback = jest.fn() + const callback = vi.fn() controller.signal.addEventListener('abort', callback) controller.abort() @@ -27,8 +27,8 @@ describe('AbortController', () => { it('add and remove events', async () => { const controller = new AbortController() - const callback = jest.fn() - const callback2 = jest.fn() + const callback = vi.fn() + const callback2 = vi.fn() controller.signal.addEventListener('abort', callback) controller.signal.addEventListener('abort', callback2) diff --git a/packages/@uppy/utils/src/ErrorWithCause.test.js b/packages/@uppy/utils/src/ErrorWithCause.test.js index 9b1923a648..9176bb65f2 100644 --- a/packages/@uppy/utils/src/ErrorWithCause.test.js +++ b/packages/@uppy/utils/src/ErrorWithCause.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import ErrorWithCause from './ErrorWithCause.js' import NetworkError from './NetworkError.js' import isNetworkError from './isNetworkError.js' diff --git a/packages/@uppy/utils/src/RateLimitedQueue.test.js b/packages/@uppy/utils/src/RateLimitedQueue.test.js index 38f97b5025..32700af090 100644 --- a/packages/@uppy/utils/src/RateLimitedQueue.test.js +++ b/packages/@uppy/utils/src/RateLimitedQueue.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import { RateLimitedQueue } from './RateLimitedQueue.js' const delay = ms => new Promise(resolve => setTimeout(resolve, ms)) diff --git a/packages/@uppy/utils/src/Translator.test.js b/packages/@uppy/utils/src/Translator.test.js index 664a1a1f91..dc8d62e951 100644 --- a/packages/@uppy/utils/src/Translator.test.js +++ b/packages/@uppy/utils/src/Translator.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Translator from './Translator.js' const english = { diff --git a/packages/@uppy/utils/src/dataURItoBlob.test.js b/packages/@uppy/utils/src/dataURItoBlob.test.js index ce9c35427f..95145d1365 100644 --- a/packages/@uppy/utils/src/dataURItoBlob.test.js +++ b/packages/@uppy/utils/src/dataURItoBlob.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import dataURItoBlob from './dataURItoBlob.js' import sampleImageDataURI from './sampleImageDataURI.js' diff --git a/packages/@uppy/utils/src/dataURItoFile.test.js b/packages/@uppy/utils/src/dataURItoFile.test.js index 28897390f9..4120267505 100644 --- a/packages/@uppy/utils/src/dataURItoFile.test.js +++ b/packages/@uppy/utils/src/dataURItoFile.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import dataURItoFile from './dataURItoFile.js' import sampleImageDataURI from './sampleImageDataURI.js' diff --git a/packages/@uppy/utils/src/delay.test.js b/packages/@uppy/utils/src/delay.test.js index 1b58abc63c..6027bf7fd4 100644 --- a/packages/@uppy/utils/src/delay.test.js +++ b/packages/@uppy/utils/src/delay.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import { AbortController } from './AbortController.js' import delay from './delay.js' diff --git a/packages/@uppy/utils/src/emaFilter.test.js b/packages/@uppy/utils/src/emaFilter.test.js index 6f6174b1a2..eba103bd05 100644 --- a/packages/@uppy/utils/src/emaFilter.test.js +++ b/packages/@uppy/utils/src/emaFilter.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import emaFilter from './emaFilter.js' describe('emaFilter', () => { diff --git a/packages/@uppy/utils/src/findIndex.test.js b/packages/@uppy/utils/src/findIndex.test.js index bb2c53b009..1dc97307a2 100644 --- a/packages/@uppy/utils/src/findIndex.test.js +++ b/packages/@uppy/utils/src/findIndex.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import findIndex from './findIndex.js' describe('findIndex', () => { diff --git a/packages/@uppy/utils/src/generateFileID.test.js b/packages/@uppy/utils/src/generateFileID.test.js index 81a13b8d3d..a7a89059c1 100644 --- a/packages/@uppy/utils/src/generateFileID.test.js +++ b/packages/@uppy/utils/src/generateFileID.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import generateFileID from './generateFileID.js' describe('generateFileID', () => { diff --git a/packages/@uppy/utils/src/getBytesRemaining.test.js b/packages/@uppy/utils/src/getBytesRemaining.test.js index 7b6e025458..0a95c53aa8 100644 --- a/packages/@uppy/utils/src/getBytesRemaining.test.js +++ b/packages/@uppy/utils/src/getBytesRemaining.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getBytesRemaining from './getBytesRemaining.js' describe('getBytesRemaining', () => { diff --git a/packages/@uppy/utils/src/getETA.test.js b/packages/@uppy/utils/src/getETA.test.js index 08cd4fd987..a72e378713 100644 --- a/packages/@uppy/utils/src/getETA.test.js +++ b/packages/@uppy/utils/src/getETA.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getETA from './getETA.js' describe('getETA', () => { diff --git a/packages/@uppy/utils/src/getFileNameAndExtension.test.js b/packages/@uppy/utils/src/getFileNameAndExtension.test.js index 6c5c58e285..6821892be8 100644 --- a/packages/@uppy/utils/src/getFileNameAndExtension.test.js +++ b/packages/@uppy/utils/src/getFileNameAndExtension.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getFileNameAndExtension from './getFileNameAndExtension.js' describe('getFileNameAndExtension', () => { diff --git a/packages/@uppy/utils/src/getFileType.test.js b/packages/@uppy/utils/src/getFileType.test.js index cff0a8029a..f920b70de0 100644 --- a/packages/@uppy/utils/src/getFileType.test.js +++ b/packages/@uppy/utils/src/getFileType.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getFileType from './getFileType.js' describe('getFileType', () => { diff --git a/packages/@uppy/utils/src/getFileTypeExtension.test.js b/packages/@uppy/utils/src/getFileTypeExtension.test.js index 0f203957b2..4f44a91310 100644 --- a/packages/@uppy/utils/src/getFileTypeExtension.test.js +++ b/packages/@uppy/utils/src/getFileTypeExtension.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getFileTypeExtension from './getFileTypeExtension.js' describe('getFileTypeExtension', () => { diff --git a/packages/@uppy/utils/src/getSocketHost.test.js b/packages/@uppy/utils/src/getSocketHost.test.js index ebd67a8bf1..068437005a 100644 --- a/packages/@uppy/utils/src/getSocketHost.test.js +++ b/packages/@uppy/utils/src/getSocketHost.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getSocketHost from './getSocketHost.js' describe('getSocketHost', () => { diff --git a/packages/@uppy/utils/src/getSpeed.test.js b/packages/@uppy/utils/src/getSpeed.test.js index 4c295fd448..124cc4c1e4 100644 --- a/packages/@uppy/utils/src/getSpeed.test.js +++ b/packages/@uppy/utils/src/getSpeed.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import getSpeed from './getSpeed.js' describe('getSpeed', () => { diff --git a/packages/@uppy/utils/src/isMobileDevice.test.js b/packages/@uppy/utils/src/isMobileDevice.test.js index 4caf901ced..a10dffbcb6 100644 --- a/packages/@uppy/utils/src/isMobileDevice.test.js +++ b/packages/@uppy/utils/src/isMobileDevice.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import isMobileDevice from './isMobileDevice.js' let fakeUserAgent = null diff --git a/packages/@uppy/utils/src/isNetworkError.test.js b/packages/@uppy/utils/src/isNetworkError.test.js index d2b53c0f53..00473d4b79 100644 --- a/packages/@uppy/utils/src/isNetworkError.test.js +++ b/packages/@uppy/utils/src/isNetworkError.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import isNetworkError from './isNetworkError.js' describe('isNetworkError', () => { diff --git a/packages/@uppy/utils/src/isObjectURL.test.js b/packages/@uppy/utils/src/isObjectURL.test.js index 9bb637ed7a..e48f8bab3c 100644 --- a/packages/@uppy/utils/src/isObjectURL.test.js +++ b/packages/@uppy/utils/src/isObjectURL.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import isObjectURL from './isObjectURL.js' describe('isObjectURL', () => { diff --git a/packages/@uppy/utils/src/isPreviewSupported.test.js b/packages/@uppy/utils/src/isPreviewSupported.test.js index 549e33f86c..8b1ce35e63 100644 --- a/packages/@uppy/utils/src/isPreviewSupported.test.js +++ b/packages/@uppy/utils/src/isPreviewSupported.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import isPreviewSupported from './isPreviewSupported.js' describe('isPreviewSupported', () => { diff --git a/packages/@uppy/utils/src/isTouchDevice.test.js b/packages/@uppy/utils/src/isTouchDevice.test.js index f65dcaf30f..c2558f27cd 100644 --- a/packages/@uppy/utils/src/isTouchDevice.test.js +++ b/packages/@uppy/utils/src/isTouchDevice.test.js @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, xit } from '@jest/globals' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' import isTouchDevice from './isTouchDevice.js' describe('isTouchDevice', () => { @@ -15,7 +15,7 @@ describe('isTouchDevice', () => { globalThis.window.ontouchstart = RealTouchStart }) - xit("should return true if it's a touch device", () => { + it.skip("should return true if it's a touch device", () => { expect(isTouchDevice()).toEqual(true) delete globalThis.window.ontouchstart globalThis.navigator.maxTouchPoints = false diff --git a/packages/@uppy/utils/src/prettyETA.test.js b/packages/@uppy/utils/src/prettyETA.test.js index 95684d454c..be99fb26a9 100644 --- a/packages/@uppy/utils/src/prettyETA.test.js +++ b/packages/@uppy/utils/src/prettyETA.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import prettyETA from './prettyETA.js' describe('prettyETA', () => { diff --git a/packages/@uppy/utils/src/secondsToTime.test.js b/packages/@uppy/utils/src/secondsToTime.test.js index 387d8a073c..7bc7fa53dc 100644 --- a/packages/@uppy/utils/src/secondsToTime.test.js +++ b/packages/@uppy/utils/src/secondsToTime.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import secondsToTime from './secondsToTime.js' describe('secondsToTime', () => { diff --git a/packages/@uppy/utils/src/settle.test.js b/packages/@uppy/utils/src/settle.test.js index e334f9581d..57d3105f60 100644 --- a/packages/@uppy/utils/src/settle.test.js +++ b/packages/@uppy/utils/src/settle.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import settle from './settle.js' describe('settle', () => { diff --git a/packages/@uppy/utils/src/toArray.test.js b/packages/@uppy/utils/src/toArray.test.js index 50e06b1d78..9bd96cac8a 100644 --- a/packages/@uppy/utils/src/toArray.test.js +++ b/packages/@uppy/utils/src/toArray.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import toArray from './toArray.js' describe('toArray', () => { diff --git a/packages/@uppy/utils/src/truncateString.test.js b/packages/@uppy/utils/src/truncateString.test.js index a1b5f585c6..24f2839860 100644 --- a/packages/@uppy/utils/src/truncateString.test.js +++ b/packages/@uppy/utils/src/truncateString.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import truncateString from './truncateString.js' describe('truncateString', () => { diff --git a/packages/@uppy/webcam/package.json b/packages/@uppy/webcam/package.json index 2fa4b3fa66..3c8bf0a27a 100644 --- a/packages/@uppy/webcam/package.json +++ b/packages/@uppy/webcam/package.json @@ -32,7 +32,7 @@ "preact": "^10.5.13" }, "devDependencies": { - "@jest/globals": "^29.0.0" + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/webcam/src/Webcam.test.js b/packages/@uppy/webcam/src/Webcam.test.js index 551808e7cd..1cd36fd1cf 100644 --- a/packages/@uppy/webcam/src/Webcam.test.js +++ b/packages/@uppy/webcam/src/Webcam.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import Uppy from '@uppy/core' import Webcam from '../lib/index.js' diff --git a/packages/@uppy/webcam/src/formatSeconds.test.js b/packages/@uppy/webcam/src/formatSeconds.test.js index e822ce8455..6ab1a4474f 100644 --- a/packages/@uppy/webcam/src/formatSeconds.test.js +++ b/packages/@uppy/webcam/src/formatSeconds.test.js @@ -1,4 +1,4 @@ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import formatSeconds from './formatSeconds.js' describe('formatSeconds', () => { diff --git a/packages/@uppy/webcam/src/supportsMediaRecorder.test.js b/packages/@uppy/webcam/src/supportsMediaRecorder.test.js index 0dad2f8209..45417c8ef4 100644 --- a/packages/@uppy/webcam/src/supportsMediaRecorder.test.js +++ b/packages/@uppy/webcam/src/supportsMediaRecorder.test.js @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file, class-methods-use-this */ -import { describe, expect, it } from '@jest/globals' +import { describe, expect, it } from 'vitest' import supportsMediaRecorder from './supportsMediaRecorder.js' describe('supportsMediaRecorder', () => { diff --git a/packages/@uppy/xhr-upload/package.json b/packages/@uppy/xhr-upload/package.json index 245b5c84ab..98fa26bd69 100644 --- a/packages/@uppy/xhr-upload/package.json +++ b/packages/@uppy/xhr-upload/package.json @@ -30,8 +30,8 @@ "nanoid": "^4.0.0" }, "devDependencies": { - "@jest/globals": "^29.0.0", - "nock": "^13.1.0" + "nock": "^13.1.0", + "vitest": "^0.34.5" }, "peerDependencies": { "@uppy/core": "workspace:^" diff --git a/packages/@uppy/xhr-upload/src/index.test.js b/packages/@uppy/xhr-upload/src/index.test.js index 0ade02e86b..520ae19274 100644 --- a/packages/@uppy/xhr-upload/src/index.test.js +++ b/packages/@uppy/xhr-upload/src/index.test.js @@ -1,4 +1,4 @@ -import { jest, describe, it, expect } from '@jest/globals' +import { vi, describe, it, expect } from 'vitest' import nock from 'nock' import Core from '@uppy/core' import XHRUpload from './index.js' @@ -15,7 +15,7 @@ describe('XHRUpload', () => { .post('/').reply(200, {}) const core = new Core() - const getResponseData = jest.fn(function getResponseData () { + const getResponseData = vi.fn(function getResponseData () { expect(this.some).toEqual('option') return {} }) @@ -50,7 +50,7 @@ describe('XHRUpload', () => { }) const core = new Core() - const validateStatus = jest.fn((status, responseText) => { + const validateStatus = vi.fn((status, responseText) => { return JSON.parse(responseText).code !== 40000 }) diff --git a/private/test/globalSetup.mjs b/private/test/globalSetup.mjs new file mode 100644 index 0000000000..98f6744a8b --- /dev/null +++ b/private/test/globalSetup.mjs @@ -0,0 +1,4 @@ +import { vi } from 'vitest' // eslint-disable-line import/no-extraneous-dependencies +import { webcrypto } from 'node:crypto' + +vi.stubGlobal('crypto', webcrypto) diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000000..670ad73206 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,14 @@ +import { configDefaults, defineConfig } from 'vitest/config' // eslint-disable-line import/no-unresolved + +export default defineConfig({ + test: { + exclude: [ + ...configDefaults.exclude, + '**/angular/**', + 'packages/@uppy/companion/*', + ], + setupFiles: [ + './private/test/globalSetup.mjs', + ], + }, +}) diff --git a/yarn.lock b/yarn.lock index e8327ccb5f..56d8613c7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4175,6 +4175,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/android-arm64@npm:0.19.3" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/android-arm@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/android-arm@npm:0.17.19" @@ -4203,6 +4210,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/android-arm@npm:0.19.3" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + "@esbuild/android-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/android-x64@npm:0.17.19" @@ -4231,6 +4245,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/android-x64@npm:0.19.3" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + "@esbuild/darwin-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/darwin-arm64@npm:0.17.19" @@ -4259,6 +4280,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-arm64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/darwin-arm64@npm:0.19.3" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/darwin-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/darwin-x64@npm:0.17.19" @@ -4287,6 +4315,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/darwin-x64@npm:0.19.3" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@esbuild/freebsd-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/freebsd-arm64@npm:0.17.19" @@ -4315,6 +4350,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-arm64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/freebsd-arm64@npm:0.19.3" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/freebsd-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/freebsd-x64@npm:0.17.19" @@ -4343,6 +4385,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/freebsd-x64@npm:0.19.3" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/linux-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-arm64@npm:0.17.19" @@ -4371,6 +4420,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-arm64@npm:0.19.3" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/linux-arm@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-arm@npm:0.17.19" @@ -4399,6 +4455,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-arm@npm:0.19.3" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + "@esbuild/linux-ia32@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-ia32@npm:0.17.19" @@ -4427,6 +4490,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ia32@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-ia32@npm:0.19.3" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/linux-loong64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-loong64@npm:0.17.19" @@ -4455,6 +4525,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-loong64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-loong64@npm:0.19.3" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + "@esbuild/linux-mips64el@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-mips64el@npm:0.17.19" @@ -4483,6 +4560,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-mips64el@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-mips64el@npm:0.19.3" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + "@esbuild/linux-ppc64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-ppc64@npm:0.17.19" @@ -4511,6 +4595,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ppc64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-ppc64@npm:0.19.3" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + "@esbuild/linux-riscv64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-riscv64@npm:0.17.19" @@ -4539,6 +4630,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-riscv64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-riscv64@npm:0.19.3" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + "@esbuild/linux-s390x@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-s390x@npm:0.17.19" @@ -4567,6 +4665,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-s390x@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-s390x@npm:0.19.3" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + "@esbuild/linux-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/linux-x64@npm:0.17.19" @@ -4595,6 +4700,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/linux-x64@npm:0.19.3" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + "@esbuild/netbsd-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/netbsd-x64@npm:0.17.19" @@ -4623,6 +4735,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/netbsd-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/netbsd-x64@npm:0.19.3" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/openbsd-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/openbsd-x64@npm:0.17.19" @@ -4651,6 +4770,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/openbsd-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/openbsd-x64@npm:0.19.3" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/sunos-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/sunos-x64@npm:0.17.19" @@ -4679,6 +4805,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/sunos-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/sunos-x64@npm:0.19.3" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + "@esbuild/win32-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/win32-arm64@npm:0.17.19" @@ -4707,6 +4840,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-arm64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/win32-arm64@npm:0.19.3" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/win32-ia32@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/win32-ia32@npm:0.17.19" @@ -4735,6 +4875,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-ia32@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/win32-ia32@npm:0.19.3" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/win32-x64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/win32-x64@npm:0.17.19" @@ -4763,6 +4910,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-x64@npm:0.19.3": + version: 0.19.3 + resolution: "@esbuild/win32-x64@npm:0.19.3" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.1.2, @eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -5136,18 +5290,6 @@ __metadata: languageName: node linkType: hard -"@jest/environment@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/environment@npm:29.0.1" - dependencies: - "@jest/fake-timers": ^29.0.1 - "@jest/types": ^29.0.1 - "@types/node": "*" - jest-mock: ^29.0.1 - checksum: d0713707b08ab995360133a6746d27d2695c034a1a74a53c5c863490f88ab9dbd05f10038fec776a6540148e7cba8277c6cace776ae30435c456f82bda1f4c3a - languageName: node - linkType: hard - "@jest/environment@npm:^29.5.0": version: 29.5.0 resolution: "@jest/environment@npm:29.5.0" @@ -5160,15 +5302,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect-utils@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/expect-utils@npm:29.0.1" - dependencies: - jest-get-type: ^29.0.0 - checksum: d2cfe72f91fcb86a3f2ffc7c09e02cba7e9da0c41705a98e7fbed016b2141ab29764b15615806ece4ed6a21b60252f024b121be68c2bd66d055305a1d34b10f8 - languageName: node - linkType: hard - "@jest/expect-utils@npm:^29.5.0": version: 29.5.0 resolution: "@jest/expect-utils@npm:29.5.0" @@ -5178,16 +5311,6 @@ __metadata: languageName: node linkType: hard -"@jest/expect@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/expect@npm:29.0.1" - dependencies: - expect: ^29.0.1 - jest-snapshot: ^29.0.1 - checksum: 408a0037620ca75c6f91390fcfbb820076b39ad4bd3db911403895ba28195621f3a6169c99e27adc4394577ea9ec88245af71384b796ca6736d931e78410a95c - languageName: node - linkType: hard - "@jest/expect@npm:^29.5.0": version: 29.5.0 resolution: "@jest/expect@npm:29.5.0" @@ -5198,20 +5321,6 @@ __metadata: languageName: node linkType: hard -"@jest/fake-timers@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/fake-timers@npm:29.0.1" - dependencies: - "@jest/types": ^29.0.1 - "@sinonjs/fake-timers": ^9.1.2 - "@types/node": "*" - jest-message-util: ^29.0.1 - jest-mock: ^29.0.1 - jest-util: ^29.0.1 - checksum: 6f4e40837b9330643bbf80a1b69a1872c53bb7c02294fb3d29baf75120aa34fc4b736ab98c64f45d81a0df0eca56d2099b2b0f6bcc32135646043ed06373e76f - languageName: node - linkType: hard - "@jest/fake-timers@npm:^29.5.0": version: 29.5.0 resolution: "@jest/fake-timers@npm:29.5.0" @@ -5226,18 +5335,6 @@ __metadata: languageName: node linkType: hard -"@jest/globals@npm:^29.0.0": - version: 29.0.1 - resolution: "@jest/globals@npm:29.0.1" - dependencies: - "@jest/environment": ^29.0.1 - "@jest/expect": ^29.0.1 - "@jest/types": ^29.0.1 - jest-mock: ^29.0.1 - checksum: 5a0f50e3bacb1b9f298be4f49f36df8fc9d656fe5f01e38fe524955a6893b1aeffad219e5001dd0ef05975e497d27660d9c335bb0c994c8c688a777344a50bda - languageName: node - linkType: hard - "@jest/globals@npm:^29.5.0": version: 29.5.0 resolution: "@jest/globals@npm:29.5.0" @@ -5287,15 +5384,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^29.0.0": - version: 29.0.0 - resolution: "@jest/schemas@npm:29.0.0" - dependencies: - "@sinclair/typebox": ^0.24.1 - checksum: 41355c78f09eb1097e57a3c5d0ca11c9099e235e01ea5fa4e3953562a79a6a9296c1d300f1ba50ca75236048829e056b00685cd2f1ff8285e56fd2ce01249acb - languageName: node - linkType: hard - "@jest/schemas@npm:^29.4.3": version: 29.4.3 resolution: "@jest/schemas@npm:29.4.3" @@ -5340,29 +5428,6 @@ __metadata: languageName: node linkType: hard -"@jest/transform@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/transform@npm:29.0.1" - dependencies: - "@babel/core": ^7.11.6 - "@jest/types": ^29.0.1 - "@jridgewell/trace-mapping": ^0.3.15 - babel-plugin-istanbul: ^6.1.1 - chalk: ^4.0.0 - convert-source-map: ^1.4.0 - fast-json-stable-stringify: ^2.1.0 - graceful-fs: ^4.2.9 - jest-haste-map: ^29.0.1 - jest-regex-util: ^29.0.0 - jest-util: ^29.0.1 - micromatch: ^4.0.4 - pirates: ^4.0.4 - slash: ^3.0.0 - write-file-atomic: ^4.0.1 - checksum: dcd1e2c46b663f90f9bf536669d142af7638b06b36e7ffa0901ae18cf3b4c1d4898189b6a08c30604dfbb7d8bcee63e166827696fa96e3406ae400ae863457e0 - languageName: node - linkType: hard - "@jest/transform@npm:^29.5.0": version: 29.5.0 resolution: "@jest/transform@npm:29.5.0" @@ -5399,20 +5464,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^29.0.1": - version: 29.0.1 - resolution: "@jest/types@npm:29.0.1" - dependencies: - "@jest/schemas": ^29.0.0 - "@types/istanbul-lib-coverage": ^2.0.0 - "@types/istanbul-reports": ^3.0.0 - "@types/node": "*" - "@types/yargs": ^17.0.8 - chalk: ^4.0.0 - checksum: 50a3658d69cad32fe270ef22e9a21cbad38c387d0b17cb1f23b144f9c9081e81623feda940b6b23459df656f88153ffe7765f36cd3bc3f3b2d8cd0ca246d75b2 - languageName: node - linkType: hard - "@jest/types@npm:^29.5.0": version: 29.5.0 resolution: "@jest/types@npm:29.5.0" @@ -7843,13 +7894,6 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.24.1": - version: 0.24.34 - resolution: "@sinclair/typebox@npm:0.24.34" - checksum: 35adcc7698fe751951e75fefe748a1d6e928afa3e52c153d1984a9d47c2a4f39e89f6adf727daef5cc12a58c71c2a0f63e3d88d105e4435252cfb68231518687 - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.25.16": version: 0.25.24 resolution: "@sinclair/typebox@npm:0.25.24" @@ -7864,15 +7908,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^1.7.0": - version: 1.8.3 - resolution: "@sinonjs/commons@npm:1.8.3" - dependencies: - type-detect: 4.0.8 - checksum: 6159726db5ce6bf9f2297f8427f7ca5b3dff45b31e5cee23496f1fa6ef0bb4eab878b23fb2c5e6446381f6a66aba4968ef2fc255c1180d753d4b8c271636a2e5 - languageName: node - linkType: hard - "@sinonjs/commons@npm:^3.0.0": version: 3.0.0 resolution: "@sinonjs/commons@npm:3.0.0" @@ -7891,15 +7926,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^9.1.2": - version: 9.1.2 - resolution: "@sinonjs/fake-timers@npm:9.1.2" - dependencies: - "@sinonjs/commons": ^1.7.0 - checksum: 7d3aef54e17c1073101cb64d953157c19d62a40e261a30923fa1ee337b049c5f29cc47b1f0c477880f42b5659848ba9ab897607ac8ea4acd5c30ddcfac57fca6 - languageName: node - linkType: hard - "@smithy/protocol-http@npm:^1.0.1": version: 1.0.1 resolution: "@smithy/protocol-http@npm:1.0.1" @@ -8206,6 +8232,22 @@ __metadata: languageName: node linkType: hard +"@types/chai-subset@npm:^1.3.3": + version: 1.3.3 + resolution: "@types/chai-subset@npm:1.3.3" + dependencies: + "@types/chai": "*" + checksum: 4481da7345022995f5a105e6683744f7203d2c3d19cfe88d8e17274d045722948abf55e0adfd97709e0f043dade37a4d4e98cd4c660e2e8a14f23e6ecf79418f + languageName: node + linkType: hard + +"@types/chai@npm:*, @types/chai@npm:^4.3.5": + version: 4.3.6 + resolution: "@types/chai@npm:4.3.6" + checksum: 32a6c18bf53fb3dbd89d1bfcadb1c6fd45cc0007c34e436393cc37a0a5a556f9e6a21d1e8dd71674c40cc36589d2f30bf4d9369d7787021e54d6e997b0d7300a + languageName: node + linkType: hard + "@types/component-emitter@npm:^1.2.10": version: 1.2.11 resolution: "@types/component-emitter@npm:1.2.11" @@ -8467,17 +8509,6 @@ __metadata: languageName: node linkType: hard -"@types/jsdom@npm:^20.0.0": - version: 20.0.0 - resolution: "@types/jsdom@npm:20.0.0" - dependencies: - "@types/node": "*" - "@types/tough-cookie": "*" - parse5: ^7.0.0 - checksum: 13e67d31347e02d46ec6a23919b3ce39d86136665922a2a6cb977e216a2f46c22d2f025d0586a64ab492ebaa5f43da669b6f173a5a8cfd3e3bb7c9d19b6cfa9e - languageName: node - linkType: hard - "@types/json-buffer@npm:~3.0.0": version: 3.0.0 resolution: "@types/json-buffer@npm:3.0.0" @@ -9005,7 +9036,6 @@ __metadata: adm-zip: ^0.5.5 autoprefixer: ^10.2.6 aws-sdk: ^2.1038.0 - babel-jest: ^29.0.0 babel-plugin-inline-package-json: ^2.0.0 chalk: ^5.0.0 concat-stream: ^2.0.0 @@ -9032,8 +9062,7 @@ __metadata: eslint-plugin-unicorn: ^46.0.0 github-contributors-list: ^1.2.4 glob: ^8.0.0 - jest: ^29.0.0 - jest-environment-jsdom: ^29.0.0 + jsdom: ^22.1.0 lint-staged: ^13.0.0 mime-types: ^2.1.26 nodemon: ^2.0.8 @@ -9056,6 +9085,7 @@ __metadata: tar: ^6.1.0 tsd: ^0.22.0 typescript: ~4.8 + vitest: ^0.34.5 vue-template-compiler: "workspace:*" languageName: unknown linkType: soft @@ -9534,9 +9564,9 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/audio@workspace:packages/@uppy/audio" dependencies: - "@jest/globals": ^29.0.0 "@uppy/utils": "workspace:^" preact: ^10.5.13 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -9548,10 +9578,10 @@ __metadata: dependencies: "@aws-sdk/client-s3": ^3.362.0 "@aws-sdk/s3-request-presigner": ^3.362.0 - "@jest/globals": ^29.0.0 "@uppy/companion-client": "workspace:^" "@uppy/utils": "workspace:^" nock: ^13.1.0 + vitest: ^0.34.5 whatwg-fetch: 3.6.2 peerDependencies: "@uppy/core": "workspace:^" @@ -9562,12 +9592,12 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/aws-s3@workspace:packages/@uppy/aws-s3" dependencies: - "@jest/globals": ^29.0.0 "@uppy/aws-s3-multipart": "workspace:^" "@uppy/companion-client": "workspace:^" "@uppy/utils": "workspace:^" "@uppy/xhr-upload": "workspace:^" nanoid: ^4.0.0 + vitest: ^0.34.5 whatwg-fetch: 3.6.2 peerDependencies: "@uppy/core": "workspace:^" @@ -9591,9 +9621,9 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/companion-client@workspace:packages/@uppy/companion-client" dependencies: - "@jest/globals": ^29.0.0 "@uppy/utils": "workspace:^" namespace-emitter: ^2.0.1 + vitest: ^0.34.5 languageName: unknown linkType: soft @@ -9670,12 +9700,12 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/compressor@workspace:packages/@uppy/compressor" dependencies: - "@jest/globals": ^29.0.0 "@transloadit/prettier-bytes": ^0.0.9 "@uppy/utils": "workspace:^" compressorjs: ^1.1.1 preact: ^10.5.13 promise-queue: ^2.2.5 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -9685,7 +9715,6 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/core@workspace:packages/@uppy/core" dependencies: - "@jest/globals": ^29.0.0 "@transloadit/prettier-bytes": 0.0.9 "@uppy/store-default": "workspace:^" "@uppy/utils": "workspace:^" @@ -9694,6 +9723,7 @@ __metadata: namespace-emitter: ^2.0.1 nanoid: ^4.0.0 preact: ^10.5.13 + vitest: ^0.34.5 languageName: unknown linkType: soft @@ -9701,7 +9731,6 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/dashboard@workspace:packages/@uppy/dashboard" dependencies: - "@jest/globals": ^29.0.0 "@transloadit/prettier-bytes": 0.0.7 "@uppy/google-drive": "workspace:^" "@uppy/informer": "workspace:^" @@ -9716,6 +9745,7 @@ __metadata: nanoid: ^4.0.0 preact: ^10.5.13 resize-observer-polyfill: ^1.5.0 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -9954,7 +9984,6 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/remote-sources@workspace:packages/@uppy/remote-sources" dependencies: - "@jest/globals": ^29.0.0 "@uppy/box": "workspace:^" "@uppy/dashboard": "workspace:^" "@uppy/dropbox": "workspace:^" @@ -9966,6 +9995,7 @@ __metadata: "@uppy/url": "workspace:^" "@uppy/zoom": "workspace:^" resize-observer-polyfill: ^1.5.1 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -9999,7 +10029,7 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/store-default@workspace:packages/@uppy/store-default" dependencies: - "@jest/globals": ^29.0.0 + vitest: ^0.34.5 languageName: unknown linkType: soft @@ -10007,9 +10037,9 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/store-redux@workspace:packages/@uppy/store-redux" dependencies: - "@jest/globals": ^29.0.0 nanoid: ^4.0.0 redux: ^4.0.0 + vitest: ^0.34.5 languageName: unknown linkType: soft @@ -10038,10 +10068,10 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/thumbnail-generator@workspace:packages/@uppy/thumbnail-generator" dependencies: - "@jest/globals": ^29.0.0 "@uppy/utils": "workspace:^" exifr: ^7.0.0 namespace-emitter: 2.0.1 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -10051,12 +10081,12 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/transloadit@workspace:packages/@uppy/transloadit" dependencies: - "@jest/globals": ^29.0.0 "@uppy/companion-client": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/tus": "workspace:^" "@uppy/utils": "workspace:^" component-emitter: ^1.2.1 + vitest: ^0.34.5 whatwg-fetch: ^3.6.2 peerDependencies: "@uppy/core": "workspace:^" @@ -10067,10 +10097,10 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/tus@workspace:packages/@uppy/tus" dependencies: - "@jest/globals": ^29.0.0 "@uppy/companion-client": "workspace:^" "@uppy/utils": "workspace:^" tus-js-client: ^3.0.0 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -10106,9 +10136,9 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/utils@workspace:packages/@uppy/utils" dependencies: - "@jest/globals": ^29.0.0 lodash: ^4.17.21 preact: ^10.5.13 + vitest: ^0.34.5 languageName: unknown linkType: soft @@ -10144,10 +10174,10 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/webcam@workspace:packages/@uppy/webcam" dependencies: - "@jest/globals": ^29.0.0 "@uppy/utils": "workspace:^" is-mobile: ^3.1.1 preact: ^10.5.13 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -10157,11 +10187,11 @@ __metadata: version: 0.0.0-use.local resolution: "@uppy/xhr-upload@workspace:packages/@uppy/xhr-upload" dependencies: - "@jest/globals": ^29.0.0 "@uppy/companion-client": "workspace:^" "@uppy/utils": "workspace:^" nanoid: ^4.0.0 nock: ^13.1.0 + vitest: ^0.34.5 peerDependencies: "@uppy/core": "workspace:^" languageName: unknown @@ -10216,6 +10246,59 @@ __metadata: languageName: node linkType: hard +"@vitest/expect@npm:0.34.5": + version: 0.34.5 + resolution: "@vitest/expect@npm:0.34.5" + dependencies: + "@vitest/spy": 0.34.5 + "@vitest/utils": 0.34.5 + chai: ^4.3.7 + checksum: 0977050db57560c5b155e0e010e5590fb53427fe06e7fa6bf2ff80ae8e29d8a1736c7854edb6b45b984b5d71f4c167bf1a25df1fa458794f1123a48f653b3062 + languageName: node + linkType: hard + +"@vitest/runner@npm:0.34.5": + version: 0.34.5 + resolution: "@vitest/runner@npm:0.34.5" + dependencies: + "@vitest/utils": 0.34.5 + p-limit: ^4.0.0 + pathe: ^1.1.1 + checksum: 022b3bb8961b57caf8bfcda13e99d41a8bec07b6ddae9a882f9878ea8e36ba71083f685b216182a7c55fa4b149944f5a67cd07f7e1939b4880006ee5a51a6ad0 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:0.34.5": + version: 0.34.5 + resolution: "@vitest/snapshot@npm:0.34.5" + dependencies: + magic-string: ^0.30.1 + pathe: ^1.1.1 + pretty-format: ^29.5.0 + checksum: 8eea3345a6eeed2e934ffa778c5217fd3f029d62343e907f9bf8ea83663b41126c90d748dfee50e157659e558d107c5cb424e33c205d411fcee59bc5b8183812 + languageName: node + linkType: hard + +"@vitest/spy@npm:0.34.5": + version: 0.34.5 + resolution: "@vitest/spy@npm:0.34.5" + dependencies: + tinyspy: ^2.1.1 + checksum: 0e786cc35c34e8bb5920b1849d3dcc3bb8f8e64d57d27f5d59c8bbeac9a858bac20c0ded046f3580a924f82130e06826b656c961fa0c985147e7a5ae38dc73f0 + languageName: node + linkType: hard + +"@vitest/utils@npm:0.34.5": + version: 0.34.5 + resolution: "@vitest/utils@npm:0.34.5" + dependencies: + diff-sequences: ^29.4.3 + loupe: ^2.3.6 + pretty-format: ^29.5.0 + checksum: 86f40d3acd43170c2fe9ca6478e57b840851cfba173a31282e2967322c9d98e0210c8399e97aeff26dc9354f00af79a6986332cfbcfeec4d067404b952f2d89f + languageName: node + linkType: hard + "@vue/babel-helper-vue-jsx-merge-props@npm:^1.2.1, @vue/babel-helper-vue-jsx-merge-props@npm:^1.4.0": version: 1.4.0 resolution: "@vue/babel-helper-vue-jsx-merge-props@npm:1.4.0" @@ -10933,6 +11016,13 @@ __metadata: languageName: node linkType: hard +"acorn-walk@npm:^8.2.0": + version: 8.2.0 + resolution: "acorn-walk@npm:8.2.0" + checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 + languageName: node + linkType: hard + "acorn@npm:^7.1.1": version: 7.4.1 resolution: "acorn@npm:7.4.1" @@ -11522,6 +11612,13 @@ __metadata: languageName: node linkType: hard +"assertion-error@npm:^1.1.0": + version: 1.1.0 + resolution: "assertion-error@npm:1.1.0" + checksum: fd9429d3a3d4fd61782eb3962ae76b6d08aa7383123fca0596020013b3ebd6647891a85b05ce821c47d1471ed1271f00b0545cf6a4326cf2fc91efcc3b0fbecf + languageName: node + linkType: hard + "assign-symbols@npm:^1.0.0": version: 1.0.0 resolution: "assign-symbols@npm:1.0.0" @@ -11761,23 +11858,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.0.0": - version: 29.0.1 - resolution: "babel-jest@npm:29.0.1" - dependencies: - "@jest/transform": ^29.0.1 - "@types/babel__core": ^7.1.14 - babel-plugin-istanbul: ^6.1.1 - babel-preset-jest: ^29.0.0 - chalk: ^4.0.0 - graceful-fs: ^4.2.9 - slash: ^3.0.0 - peerDependencies: - "@babel/core": ^7.8.0 - checksum: 8aa919a981eb8129e16d802e5fd19674fdf4a6bacf11ce2360ebff2fa3aad013e8b14afa3ab247ebea26e4b64cad131036e42310fd9022ffc6a081fc7378914f - languageName: node - linkType: hard - "babel-jest@npm:^29.5.0": version: 29.5.0 resolution: "babel-jest@npm:29.5.0" @@ -11828,18 +11908,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jest-hoist@npm:^29.0.0": - version: 29.0.0 - resolution: "babel-plugin-jest-hoist@npm:29.0.0" - dependencies: - "@babel/template": ^7.3.3 - "@babel/types": ^7.3.3 - "@types/babel__core": ^7.1.14 - "@types/babel__traverse": ^7.0.6 - checksum: e6f4c0821369bfb7e24e9cb7f62457dad9a38060a29c55775cfd6b99a0f21746b7b762eefab63544b3e7d807c135505253c50e931bf64a1875b5c64bea56e60b - languageName: node - linkType: hard - "babel-plugin-jest-hoist@npm:^29.5.0": version: 29.5.0 resolution: "babel-plugin-jest-hoist@npm:29.5.0" @@ -12024,18 +12092,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-jest@npm:^29.0.0": - version: 29.0.0 - resolution: "babel-preset-jest@npm:29.0.0" - dependencies: - babel-plugin-jest-hoist: ^29.0.0 - babel-preset-current-node-syntax: ^1.0.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: b93b4c5a801527246a34ef847764e462ad4789893190cbefc3c42df972cdd057d0e50910650503d1051b3503dc89b9c2d06488c6d57e11fddcaac96cf3f7818a - languageName: node - linkType: hard - "babel-preset-jest@npm:^29.5.0": version: 29.5.0 resolution: "babel-preset-jest@npm:29.5.0" @@ -12511,6 +12567,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^6.7.14": + version: 6.7.14 + resolution: "cac@npm:6.7.14" + checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a + languageName: node + linkType: hard + "cacache@npm:^16.0.0, cacache@npm:^16.1.0": version: 16.1.3 resolution: "cacache@npm:16.1.3" @@ -12738,6 +12801,21 @@ __metadata: languageName: node linkType: hard +"chai@npm:^4.3.7": + version: 4.3.8 + resolution: "chai@npm:4.3.8" + dependencies: + assertion-error: ^1.1.0 + check-error: ^1.0.2 + deep-eql: ^4.1.2 + get-func-name: ^2.0.0 + loupe: ^2.3.1 + pathval: ^1.1.1 + type-detect: ^4.0.5 + checksum: 29e0984ed13308319cadc35437c8ef0a3e271544d226c991bf7e3b6d771bf89707321669e11d05e362bc0ad0bd26585079b989d1032f3c106e3bb95d7f079cce + languageName: node + linkType: hard + "chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -12818,6 +12896,13 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^1.0.2": + version: 1.0.2 + resolution: "check-error@npm:1.0.2" + checksum: d9d106504404b8addd1ee3f63f8c0eaa7cd962a1a28eb9c519b1c4a1dc7098be38007fc0060f045ee00f075fbb7a2a4f42abcf61d68323677e11ab98dc16042e + languageName: node + linkType: hard + "check-more-types@npm:2.24.0, check-more-types@npm:^2.24.0": version: 2.24.0 resolution: "check-more-types@npm:2.24.0" @@ -13467,7 +13552,7 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.1.0, convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": +"convert-source-map@npm:^1.1.0, convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": version: 1.8.0 resolution: "convert-source-map@npm:1.8.0" dependencies: @@ -13929,13 +14014,6 @@ __metadata: languageName: node linkType: hard -"cssom@npm:^0.5.0": - version: 0.5.0 - resolution: "cssom@npm:0.5.0" - checksum: 823471aa30091c59e0a305927c30e7768939b6af70405808f8d2ce1ca778cddcb24722717392438329d1691f9a87cb0183b64b8d779b56a961546d54854fde01 - languageName: node - linkType: hard - "cssom@npm:~0.3.6": version: 0.3.8 resolution: "cssom@npm:0.3.8" @@ -13952,6 +14030,15 @@ __metadata: languageName: node linkType: hard +"cssstyle@npm:^3.0.0": + version: 3.0.0 + resolution: "cssstyle@npm:3.0.0" + dependencies: + rrweb-cssom: ^0.6.0 + checksum: 31f694dfed9998ed93570fe539610837b878193dd8487c33cb12db8004333c53c2a3904166288bbec68388c72fb01014d46d3243ddfb02fe845989d852c06f27 + languageName: node + linkType: hard + "csstype@npm:^2.6.8": version: 2.6.20 resolution: "csstype@npm:2.6.20" @@ -14094,14 +14181,14 @@ __metadata: languageName: node linkType: hard -"data-urls@npm:^3.0.2": - version: 3.0.2 - resolution: "data-urls@npm:3.0.2" +"data-urls@npm:^4.0.0": + version: 4.0.0 + resolution: "data-urls@npm:4.0.0" dependencies: abab: ^2.0.6 whatwg-mimetype: ^3.0.0 - whatwg-url: ^11.0.0 - checksum: 033fc3dd0fba6d24bc9a024ddcf9923691dd24f90a3d26f6545d6a2f71ec6956f93462f2cdf2183cc46f10dc01ed3bcb36731a8208456eb1a08147e571fe2a76 + whatwg-url: ^12.0.0 + checksum: 006e869b5bf079647949a3e9b1dd69d84b2d5d26e6b01c265485699bc96e83817d4b5aae758b2910a4c58c0601913f3a0034121c1ca2da268e9a244c57515b15 languageName: node linkType: hard @@ -14201,20 +14288,13 @@ __metadata: languageName: node linkType: hard -"decimal.js@npm:^10.2.1": +"decimal.js@npm:^10.2.1, decimal.js@npm:^10.4.3": version: 10.4.3 resolution: "decimal.js@npm:10.4.3" checksum: 796404dcfa9d1dbfdc48870229d57f788b48c21c603c3f6554a1c17c10195fc1024de338b0cf9e1efe0c7c167eeb18f04548979bcc5fdfabebb7cc0ae3287bae languageName: node linkType: hard -"decimal.js@npm:^10.3.1": - version: 10.4.0 - resolution: "decimal.js@npm:10.4.0" - checksum: 98702d9d817a9e5b3767ea6580e7f3b35544b9454e463a5dd5d3232131470f39067d02864c45cab009eb1200bc162cd26a33d34c622cd79e4657a3e25e95fb4e - languageName: node - linkType: hard - "decode-named-character-reference@npm:^1.0.0": version: 1.0.2 resolution: "decode-named-character-reference@npm:1.0.2" @@ -14254,6 +14334,15 @@ __metadata: languageName: node linkType: hard +"deep-eql@npm:^4.1.2": + version: 4.1.3 + resolution: "deep-eql@npm:4.1.3" + dependencies: + type-detect: ^4.0.0 + checksum: 7f6d30cb41c713973dc07eaadded848b2ab0b835e518a88b91bea72f34e08c4c71d167a722a6f302d3a6108f05afd8e6d7650689a84d5d29ec7fe6220420397f + languageName: node + linkType: hard + "deep-equal@npm:^2.0.5": version: 2.2.0 resolution: "deep-equal@npm:2.2.0" @@ -15509,7 +15598,84 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: f9ad8ad4f0cbcc675c059f2676c4458d75307af20f9168859de8642accd7f2b7d6bbe8286a23633790dcba07d1d66a8f63c204ea933a0d51300c1b69d4f25d8f + checksum: f9ad8ad4f0cbcc675c059f2676c4458d75307af20f9168859de8642accd7f2b7d6bbe8286a23633790dcba07d1d66a8f63c204ea933a0d51300c1b69d4f25d8f + languageName: node + linkType: hard + +"esbuild@npm:^0.19.3": + version: 0.19.3 + resolution: "esbuild@npm:0.19.3" + dependencies: + "@esbuild/android-arm": 0.19.3 + "@esbuild/android-arm64": 0.19.3 + "@esbuild/android-x64": 0.19.3 + "@esbuild/darwin-arm64": 0.19.3 + "@esbuild/darwin-x64": 0.19.3 + "@esbuild/freebsd-arm64": 0.19.3 + "@esbuild/freebsd-x64": 0.19.3 + "@esbuild/linux-arm": 0.19.3 + "@esbuild/linux-arm64": 0.19.3 + "@esbuild/linux-ia32": 0.19.3 + "@esbuild/linux-loong64": 0.19.3 + "@esbuild/linux-mips64el": 0.19.3 + "@esbuild/linux-ppc64": 0.19.3 + "@esbuild/linux-riscv64": 0.19.3 + "@esbuild/linux-s390x": 0.19.3 + "@esbuild/linux-x64": 0.19.3 + "@esbuild/netbsd-x64": 0.19.3 + "@esbuild/openbsd-x64": 0.19.3 + "@esbuild/sunos-x64": 0.19.3 + "@esbuild/win32-arm64": 0.19.3 + "@esbuild/win32-ia32": 0.19.3 + "@esbuild/win32-x64": 0.19.3 + dependenciesMeta: + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: f998ba82b1bbf0f3036201dc2cb94f92aff887b7552738ea3e4dd6f386f87740ef76aabae2fc1c4b91a519354d390f6d9fd89eb71e26882983f6fbaf75369206 languageName: node linkType: hard @@ -16295,19 +16461,6 @@ __metadata: languageName: node linkType: hard -"expect@npm:^29.0.1": - version: 29.0.1 - resolution: "expect@npm:29.0.1" - dependencies: - "@jest/expect-utils": ^29.0.1 - jest-get-type: ^29.0.0 - jest-matcher-utils: ^29.0.1 - jest-message-util: ^29.0.1 - jest-util: ^29.0.1 - checksum: 103d9ecd00d5caefa0e536cde7abefa767f66d0e9ed8e00cf9e1bc1a14dfcee02080ebb9857974250dc68f3e525a85d81796fc37e405838d4cdb3613d76e48a4 - languageName: node - linkType: hard - "expect@npm:^29.5.0": version: 29.5.0 resolution: "expect@npm:29.5.0" @@ -17412,6 +17565,16 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: latest + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 + conditions: os=darwin + languageName: node + linkType: hard + "fsevents@patch:fsevents@^2.1.2#~builtin, fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" @@ -17421,6 +17584,15 @@ __metadata: languageName: node linkType: hard +"fsevents@patch:fsevents@~2.3.3#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: latest + conditions: os=darwin + languageName: node + linkType: hard + "function-bind@npm:^1.1.1": version: 1.1.1 resolution: "function-bind@npm:1.1.1" @@ -17500,6 +17672,13 @@ __metadata: languageName: node linkType: hard +"get-func-name@npm:^2.0.0": + version: 2.0.0 + resolution: "get-func-name@npm:2.0.0" + checksum: 8d82e69f3e7fab9e27c547945dfe5cc0c57fc0adf08ce135dddb01081d75684a03e7a0487466f478872b341d52ac763ae49e660d01ab83741f74932085f693c3 + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1": version: 1.1.2 resolution: "get-intrinsic@npm:1.1.2" @@ -19808,48 +19987,6 @@ __metadata: languageName: node linkType: hard -"jest-environment-jsdom@npm:29.5.0": - version: 29.5.0 - resolution: "jest-environment-jsdom@npm:29.5.0" - dependencies: - "@jest/environment": ^29.5.0 - "@jest/fake-timers": ^29.5.0 - "@jest/types": ^29.5.0 - "@types/jsdom": ^20.0.0 - "@types/node": "*" - jest-mock: ^29.5.0 - jest-util: ^29.5.0 - jsdom: ^20.0.0 - peerDependencies: - canvas: ^2.5.0 - peerDependenciesMeta: - canvas: - optional: true - checksum: 3df7fc85275711f20b483ac8cd8c04500704ed0f69791eb55c574b38f5a39470f03d775cf20c1025bc1884916ac0573aa2fa4db1bb74225bc7fdd95ba97ad0da - languageName: node - linkType: hard - -"jest-environment-jsdom@patch:jest-environment-jsdom@npm:29.5.0#.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch::locator=%40uppy-dev%2Fbuild%40workspace%3A.": - version: 29.5.0 - resolution: "jest-environment-jsdom@patch:jest-environment-jsdom@npm%3A29.5.0#.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch::version=29.5.0&hash=28f236&locator=%40uppy-dev%2Fbuild%40workspace%3A." - dependencies: - "@jest/environment": ^29.5.0 - "@jest/fake-timers": ^29.5.0 - "@jest/types": ^29.5.0 - "@types/jsdom": ^20.0.0 - "@types/node": "*" - jest-mock: ^29.5.0 - jest-util: ^29.5.0 - jsdom: ^20.0.0 - peerDependencies: - canvas: ^2.5.0 - peerDependenciesMeta: - canvas: - optional: true - checksum: 353223bab372739f7edfd686711c52721d5f7311338a5842476fd9b1c947adb95f56369c0ae2927d38a94a3dc5da1b5b4c3997cb36bf3c8081f74c84f17527a7 - languageName: node - linkType: hard - "jest-environment-node@npm:^29.5.0": version: 29.5.0 resolution: "jest-environment-node@npm:29.5.0" @@ -19871,7 +20008,7 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^29.0.0, jest-get-type@npm:^29.4.3": +"jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" checksum: 6ac7f2dde1c65e292e4355b6c63b3a4897d7e92cb4c8afcf6d397f2682f8080e094c8b0b68205a74d269882ec06bf696a9de6cd3e1b7333531e5ed7b112605ce @@ -19903,7 +20040,7 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^29.0.1, jest-haste-map@npm:^29.5.0": +"jest-haste-map@npm:^29.5.0": version: 29.5.0 resolution: "jest-haste-map@npm:29.5.0" dependencies: @@ -19936,7 +20073,7 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^29.0.1, jest-matcher-utils@npm:^29.5.0": +"jest-matcher-utils@npm:^29.5.0": version: 29.5.0 resolution: "jest-matcher-utils@npm:29.5.0" dependencies: @@ -19948,7 +20085,7 @@ __metadata: languageName: node linkType: hard -"jest-message-util@npm:^29.0.1, jest-message-util@npm:^29.5.0": +"jest-message-util@npm:^29.5.0": version: 29.5.0 resolution: "jest-message-util@npm:29.5.0" dependencies: @@ -19965,7 +20102,7 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^29.0.1, jest-mock@npm:^29.5.0": +"jest-mock@npm:^29.5.0": version: 29.5.0 resolution: "jest-mock@npm:29.5.0" dependencies: @@ -19995,7 +20132,7 @@ __metadata: languageName: node linkType: hard -"jest-regex-util@npm:^29.0.0, jest-regex-util@npm:^29.4.3": +"jest-regex-util@npm:^29.4.3": version: 29.4.3 resolution: "jest-regex-util@npm:29.4.3" checksum: 96fc7fc28cd4dd73a63c13a526202c4bd8b351d4e5b68b1a2a2c88da3308c2a16e26feaa593083eb0bac38cca1aa9dd05025412e7de013ba963fb8e66af22b8a @@ -20098,7 +20235,7 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@npm:^29.0.1, jest-snapshot@npm:^29.5.0": +"jest-snapshot@npm:^29.5.0": version: 29.5.0 resolution: "jest-snapshot@npm:29.5.0" dependencies: @@ -20143,7 +20280,7 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^29.0.1, jest-util@npm:^29.5.0": +"jest-util@npm:^29.5.0": version: 29.5.0 resolution: "jest-util@npm:29.5.0" dependencies: @@ -20443,43 +20580,39 @@ __metadata: languageName: node linkType: hard -"jsdom@npm:^20.0.0": - version: 20.0.0 - resolution: "jsdom@npm:20.0.0" +"jsdom@npm:^22.1.0": + version: 22.1.0 + resolution: "jsdom@npm:22.1.0" dependencies: abab: ^2.0.6 - acorn: ^8.7.1 - acorn-globals: ^6.0.0 - cssom: ^0.5.0 - cssstyle: ^2.3.0 - data-urls: ^3.0.2 - decimal.js: ^10.3.1 + cssstyle: ^3.0.0 + data-urls: ^4.0.0 + decimal.js: ^10.4.3 domexception: ^4.0.0 - escodegen: ^2.0.0 form-data: ^4.0.0 html-encoding-sniffer: ^3.0.0 http-proxy-agent: ^5.0.0 https-proxy-agent: ^5.0.1 is-potential-custom-element-name: ^1.0.1 - nwsapi: ^2.2.0 - parse5: ^7.0.0 + nwsapi: ^2.2.4 + parse5: ^7.1.2 + rrweb-cssom: ^0.6.0 saxes: ^6.0.0 symbol-tree: ^3.2.4 - tough-cookie: ^4.0.0 - w3c-hr-time: ^1.0.2 - w3c-xmlserializer: ^3.0.0 + tough-cookie: ^4.1.2 + w3c-xmlserializer: ^4.0.0 webidl-conversions: ^7.0.0 whatwg-encoding: ^2.0.0 whatwg-mimetype: ^3.0.0 - whatwg-url: ^11.0.0 - ws: ^8.8.0 + whatwg-url: ^12.0.1 + ws: ^8.13.0 xml-name-validator: ^4.0.0 peerDependencies: canvas: ^2.5.0 peerDependenciesMeta: canvas: optional: true - checksum: f69b40679d8cfaee2353615445aaff08b823c53dc7778ede6592d02ed12b3e9fb4e8db2b6d033551b67e08424a3adb2b79d231caa7dcda2d16019c20c705c11f + checksum: d955ab83a6dad3e6af444098d30647c719bbb4cf97de053aa5751c03c8d6f3283d8c4d7fc2774c181f1d432fb0250e7332bc159e6b466424f4e337d73adcbf30 languageName: node linkType: hard @@ -21403,6 +21536,13 @@ __metadata: languageName: node linkType: hard +"local-pkg@npm:^0.4.3": + version: 0.4.3 + resolution: "local-pkg@npm:0.4.3" + checksum: 7825aca531dd6afa3a3712a0208697aa4a5cd009065f32e3fb732aafcc42ed11f277b5ac67229222e96f4def55197171cdf3d5522d0381b489d2e5547b407d55 + languageName: node + linkType: hard + "locate-character@npm:^3.0.0": version: 3.0.0 resolution: "locate-character@npm:3.0.0" @@ -21747,6 +21887,15 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^2.3.1, loupe@npm:^2.3.6": + version: 2.3.6 + resolution: "loupe@npm:2.3.6" + dependencies: + get-func-name: ^2.0.0 + checksum: cc83f1b124a1df7384601d72d8d1f5fe95fd7a8185469fec48bb2e4027e45243949e7a013e8d91051a138451ff0552310c32aa9786e60b6a30d1e801bdc2163f + languageName: node + linkType: hard + "lowercase-keys@npm:^2.0.0": version: 2.0.0 resolution: "lowercase-keys@npm:2.0.0" @@ -21839,7 +21988,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.0": +"magic-string@npm:^0.30.0, magic-string@npm:^0.30.1": version: 0.30.3 resolution: "magic-string@npm:0.30.3" dependencies: @@ -23305,6 +23454,18 @@ __metadata: languageName: node linkType: hard +"mlly@npm:^1.2.0, mlly@npm:^1.4.0": + version: 1.4.2 + resolution: "mlly@npm:1.4.2" + dependencies: + acorn: ^8.10.0 + pathe: ^1.1.1 + pkg-types: ^1.0.3 + ufo: ^1.3.0 + checksum: ad0813eca133e59ac03b356b87deea57da96083dce7dda58a8eeb2dce92b7cc2315bedd9268f3ff8e98effe1867ddb1307486d4c5cd8be162daa8e0fa0a98ed4 + languageName: node + linkType: hard + "moment-timezone@npm:^0.5.31": version: 0.5.37 resolution: "moment-timezone@npm:0.5.37" @@ -24256,6 +24417,13 @@ __metadata: languageName: node linkType: hard +"nwsapi@npm:^2.2.4": + version: 2.2.7 + resolution: "nwsapi@npm:2.2.7" + checksum: cab25f7983acec7e23490fec3ef7be608041b460504229770e3bfcf9977c41d6fe58f518994d3bd9aa3a101f501089a3d4a63536f4ff8ae4b8c4ca23bdbfda4e + languageName: node + linkType: hard + "nx@npm:16.5.1": version: 16.5.1 resolution: "nx@npm:16.5.1" @@ -25099,6 +25267,15 @@ __metadata: languageName: node linkType: hard +"parse5@npm:^7.1.2": + version: 7.1.2 + resolution: "parse5@npm:7.1.2" + dependencies: + entities: ^4.4.0 + checksum: 59465dd05eb4c5ec87b76173d1c596e152a10e290b7abcda1aecf0f33be49646ea74840c69af975d7887543ea45564801736356c568d6b5e71792fd0f4055713 + languageName: node + linkType: hard + "parseurl@npm:^1.3.3, parseurl@npm:~1.3.2, parseurl@npm:~1.3.3": version: 1.3.3 resolution: "parseurl@npm:1.3.3" @@ -25209,6 +25386,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^1.1.0, pathe@npm:^1.1.1": + version: 1.1.1 + resolution: "pathe@npm:1.1.1" + checksum: 34ab3da2e5aa832ebc6a330ffe3f73d7ba8aec6e899b53b8ec4f4018de08e40742802deb12cf5add9c73b7bf719b62c0778246bd376ca62b0fb23e0dde44b759 + languageName: node + linkType: hard + +"pathval@npm:^1.1.1": + version: 1.1.1 + resolution: "pathval@npm:1.1.1" + checksum: 090e3147716647fb7fb5b4b8c8e5b55e5d0a6086d085b6cd23f3d3c01fcf0ff56fd3cc22f2f4a033bd2e46ed55d61ed8379e123b42afe7d531a2a5fc8bb556d6 + languageName: node + linkType: hard + "pause-stream@npm:0.0.11": version: 0.0.11 resolution: "pause-stream@npm:0.0.11" @@ -25367,6 +25558,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^1.0.3": + version: 1.0.3 + resolution: "pkg-types@npm:1.0.3" + dependencies: + jsonc-parser: ^3.2.0 + mlly: ^1.2.0 + pathe: ^1.1.0 + checksum: 4b305c834b912ddcc8a0fe77530c0b0321fe340396f84cbb87aecdbc126606f47f2178f23b8639e71a4870f9631c7217aef52ffed0ae17ea2dbbe7e43d116a6e + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -25970,6 +26172,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.4.30": + version: 8.4.30 + resolution: "postcss@npm:8.4.30" + dependencies: + nanoid: ^3.3.6 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: 6c810c10c9bd3e03ca016e0b6b6756261e640aba1a9a7b1200b55502bc34b9165e38f590aef3493afc2f30ab55cdfcd43fd0f8408d69a77318ddbcf2a8ad164b + languageName: node + linkType: hard + "posthtml-parser@npm:^0.10.1": version: 0.10.2 resolution: "posthtml-parser@npm:0.10.2" @@ -26312,6 +26525,13 @@ __metadata: languageName: node linkType: hard +"punycode@npm:^2.3.0": + version: 2.3.0 + resolution: "punycode@npm:2.3.0" + checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 + languageName: node + linkType: hard + "pure-rand@npm:^6.0.0": version: 6.0.2 resolution: "pure-rand@npm:6.0.2" @@ -27855,6 +28075,27 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^3.29.2": + version: 3.29.3 + resolution: "rollup@npm:3.29.3" + dependencies: + fsevents: ~2.3.2 + dependenciesMeta: + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 46dfbfbb57f2a53c79d67482a4a92146def3e5d939ecd914a99745d406dbb77598d4e3cc08057468628ae9fa5d7bfddb605a986b6fe1b6e952eda6db3dcabbe1 + languageName: node + linkType: hard + +"rrweb-cssom@npm:^0.6.0": + version: 0.6.0 + resolution: "rrweb-cssom@npm:0.6.0" + checksum: 182312f6e4f41d18230ccc34f14263bc8e8a6b9d30ee3ec0d2d8e643c6f27964cd7a8d638d4a00e988d93e8dc55369f4ab5a473ccfeff7a8bab95b36d2b5499c + languageName: node + linkType: hard + "rsvp@npm:^4.8.4": version: 4.8.5 resolution: "rsvp@npm:4.8.5" @@ -28488,6 +28729,13 @@ __metadata: languageName: node linkType: hard +"siginfo@npm:^2.0.0": + version: 2.0.0 + resolution: "siginfo@npm:2.0.0" + checksum: 8aa5a98640ca09fe00d74416eca97551b3e42991614a3d1b824b115fc1401543650914f651ab1311518177e4d297e80b953f4cd4cd7ea1eabe824e8f2091de01 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -29039,6 +29287,13 @@ __metadata: languageName: node linkType: hard +"stackback@npm:0.0.2": + version: 0.0.2 + resolution: "stackback@npm:0.0.2" + checksum: 2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99 + languageName: node + linkType: hard + "stackframe@npm:^1.3.4": version: 1.3.4 resolution: "stackframe@npm:1.3.4" @@ -29117,6 +29372,13 @@ __metadata: languageName: node linkType: hard +"std-env@npm:^3.3.3": + version: 3.4.3 + resolution: "std-env@npm:3.4.3" + checksum: bef186fb2baddda31911234b1e58fa18f181eb6930616aaec3b54f6d5db65f2da5daaa5f3b326b98445a7d50ca81d6fe8809ab4ebab85ecbe4a802f1b40921bf + languageName: node + linkType: hard + "stop-iteration-iterator@npm:^1.0.0": version: 1.0.0 resolution: "stop-iteration-iterator@npm:1.0.0" @@ -29410,6 +29672,15 @@ __metadata: languageName: node linkType: hard +"strip-literal@npm:^1.0.1": + version: 1.3.0 + resolution: "strip-literal@npm:1.3.0" + dependencies: + acorn: ^8.10.0 + checksum: f5fa7e289df8ebe82e90091fd393974faf8871be087ca50114327506519323cf15f2f8fee6ebe68b5e58bfc795269cae8bdc7cb5a83e27b02b3fe953f37b0a89 + languageName: node + linkType: hard + "strnum@npm:^1.0.5": version: 1.0.5 resolution: "strnum@npm:1.0.5" @@ -30169,6 +30440,13 @@ __metadata: languageName: node linkType: hard +"tinybench@npm:^2.5.0": + version: 2.5.1 + resolution: "tinybench@npm:2.5.1" + checksum: 6d98526c00b68b50ab0a37590b3cc6713b96fee7dd6756a2a77bab071ed1b4a4fc54e7b11e28b35ec2f761c6a806c2befa95f10acf2fee111c49327b6fc3386f + languageName: node + linkType: hard + "tinydate@npm:^1.0.0": version: 1.3.0 resolution: "tinydate@npm:1.3.0" @@ -30176,6 +30454,20 @@ __metadata: languageName: node linkType: hard +"tinypool@npm:^0.7.0": + version: 0.7.0 + resolution: "tinypool@npm:0.7.0" + checksum: fdcccd5c750574fce51f8801a877f8284e145d12b79cd5f2d72bfbddfe20c895e915555bc848e122bb6aa968098e7ac4fe1e8e88104904d518dc01cccd18a510 + languageName: node + linkType: hard + +"tinyspy@npm:^2.1.1": + version: 2.1.1 + resolution: "tinyspy@npm:2.1.1" + checksum: cfe669803a7f11ca912742b84c18dcc4ceecaa7661c69bc5eb608a8a802d541c48aba220df8929f6c8cd09892ad37cb5ba5958ddbbb57940e91d04681d3cee73 + languageName: node + linkType: hard + "tmp@npm:0.2.1, tmp@npm:^0.2.1, tmp@npm:~0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" @@ -30295,6 +30587,18 @@ __metadata: languageName: node linkType: hard +"tough-cookie@npm:^4.1.2": + version: 4.1.3 + resolution: "tough-cookie@npm:4.1.3" + dependencies: + psl: ^1.1.33 + punycode: ^2.1.1 + universalify: ^0.2.0 + url-parse: ^1.5.3 + checksum: c9226afff36492a52118432611af083d1d8493a53ff41ec4ea48e5b583aec744b989e4280bcf476c910ec1525a89a4a0f1cae81c08b18fb2ec3a9b3a72b91dcc + languageName: node + linkType: hard + "tough-cookie@npm:~2.5.0": version: 2.5.0 resolution: "tough-cookie@npm:2.5.0" @@ -30314,12 +30618,12 @@ __metadata: languageName: node linkType: hard -"tr46@npm:^3.0.0": - version: 3.0.0 - resolution: "tr46@npm:3.0.0" +"tr46@npm:^4.1.1": + version: 4.1.1 + resolution: "tr46@npm:4.1.1" dependencies: - punycode: ^2.1.1 - checksum: 44c3cc6767fb800490e6e9fd64fd49041aa4e49e1f6a012b34a75de739cc9ed3a6405296072c1df8b6389ae139c5e7c6496f659cfe13a04a4bff3a1422981270 + punycode: ^2.3.0 + checksum: aeeb821ac2cd792e63ec84888b4fd6598ac6ed75d861579e21a5cf9d4ee78b2c6b94e7d45036f2ca2088bc85b9b46560ad23c4482979421063b24137349dbd96 languageName: node linkType: hard @@ -30519,7 +30823,7 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": +"type-detect@npm:4.0.8, type-detect@npm:^4.0.0, type-detect@npm:^4.0.5": version: 4.0.8 resolution: "type-detect@npm:4.0.8" checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 @@ -30704,6 +31008,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.3.0": + version: 1.3.0 + resolution: "ufo@npm:1.3.0" + checksum: 01f0be86cd5c205ad1b49ebea985e000a4542c503ee75398302b0f5e4b9a6d9cd8e77af2dc614ab7bea08805fdfd9a85191fb3b5ee3df383cb936cf65e9db30d + languageName: node + linkType: hard + "uglify-es@npm:^3.1.9": version: 3.3.10 resolution: "uglify-es@npm:3.3.10" @@ -31500,6 +31811,22 @@ __metadata: languageName: node linkType: hard +"vite-node@npm:0.34.5": + version: 0.34.5 + resolution: "vite-node@npm:0.34.5" + dependencies: + cac: ^6.7.14 + debug: ^4.3.4 + mlly: ^1.4.0 + pathe: ^1.1.1 + picocolors: ^1.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0-0 + bin: + vite-node: vite-node.mjs + checksum: a992809c70b9d8b74e45e2789e7817c7c4f8569bec971e5be1046b2d7b05f0d317c04858738e620be903e2c6165603476a41f07f0c9e49635b367d291385266e + languageName: node + linkType: hard + "vite-plugin-vue2@npm:^2.0.1": version: 2.0.3 resolution: "vite-plugin-vue2@npm:2.0.3" @@ -31580,6 +31907,46 @@ __metadata: languageName: node linkType: hard +"vite@npm:^3.0.0 || ^4.0.0 || ^5.0.0-0, vite@npm:^3.1.0 || ^4.0.0 || ^5.0.0-0": + version: 5.0.0-beta.3 + resolution: "vite@npm:5.0.0-beta.3" + dependencies: + esbuild: ^0.19.3 + fsevents: ~2.3.3 + postcss: ^8.4.30 + rollup: ^3.29.2 + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 03b6f004a3fc65c5d820590aaefa65bd9dcf609bb8f151e67ff2237d35cbbad14d8f27860f9408d6777b250ffa4c3cccacef9b61a43002024d0382e1d63fe518 + languageName: node + linkType: hard + "vite@npm:^4.0.0": version: 4.3.9 resolution: "vite@npm:4.3.9" @@ -31617,6 +31984,66 @@ __metadata: languageName: node linkType: hard +"vitest@npm:^0.34.5": + version: 0.34.5 + resolution: "vitest@npm:0.34.5" + dependencies: + "@types/chai": ^4.3.5 + "@types/chai-subset": ^1.3.3 + "@types/node": "*" + "@vitest/expect": 0.34.5 + "@vitest/runner": 0.34.5 + "@vitest/snapshot": 0.34.5 + "@vitest/spy": 0.34.5 + "@vitest/utils": 0.34.5 + acorn: ^8.9.0 + acorn-walk: ^8.2.0 + cac: ^6.7.14 + chai: ^4.3.7 + debug: ^4.3.4 + local-pkg: ^0.4.3 + magic-string: ^0.30.1 + pathe: ^1.1.1 + picocolors: ^1.0.0 + std-env: ^3.3.3 + strip-literal: ^1.0.1 + tinybench: ^2.5.0 + tinypool: ^0.7.0 + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 + vite-node: 0.34.5 + why-is-node-running: ^2.2.2 + peerDependencies: + "@edge-runtime/vm": "*" + "@vitest/browser": "*" + "@vitest/ui": "*" + happy-dom: "*" + jsdom: "*" + playwright: "*" + safaridriver: "*" + webdriverio: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + bin: + vitest: vitest.mjs + checksum: 076c20401343dab2612804bdcbc3aa5e12ca1bc8f79ed5ed0e3d85edb29bdf7ad6e98c48348d77b99a57b337e633ea611dcf9a136f7fd94cd874811edb3af801 + languageName: node + linkType: hard + "vlq@npm:^1.0.0": version: 1.0.1 resolution: "vlq@npm:1.0.1" @@ -31717,12 +32144,12 @@ __metadata: languageName: node linkType: hard -"w3c-xmlserializer@npm:^3.0.0": - version: 3.0.0 - resolution: "w3c-xmlserializer@npm:3.0.0" +"w3c-xmlserializer@npm:^4.0.0": + version: 4.0.0 + resolution: "w3c-xmlserializer@npm:4.0.0" dependencies: xml-name-validator: ^4.0.0 - checksum: 0af8589942eeb11c9fe29eb31a1a09f3d5dd136aea53a9848dfbabff79ac0dd26fe13eb54d330d5555fe27bb50b28dca0715e09f9cc2bfa7670ccc8b7f919ca2 + checksum: eba070e78deb408ae8defa4d36b429f084b2b47a4741c4a9be3f27a0a3d1845e277e3072b04391a138f7e43776842627d1334e448ff13ff90ad9fb1214ee7091 languageName: node linkType: hard @@ -32070,13 +32497,13 @@ __metadata: languageName: node linkType: hard -"whatwg-url@npm:^11.0.0": - version: 11.0.0 - resolution: "whatwg-url@npm:11.0.0" +"whatwg-url@npm:^12.0.0, whatwg-url@npm:^12.0.1": + version: 12.0.1 + resolution: "whatwg-url@npm:12.0.1" dependencies: - tr46: ^3.0.0 + tr46: ^4.1.1 webidl-conversions: ^7.0.0 - checksum: ed4826aaa57e66bb3488a4b25c9cd476c46ba96052747388b5801f137dd740b73fde91ad207d96baf9f17fbcc80fc1a477ad65181b5eb5fa718d27c69501d7af + checksum: 8698993b763c1e7eda5ed16c31dab24bca6489626aca7caf8b5a2b64684dda6578194786f10ec42ceb1c175feea16d0a915096e6419e08d154ce551c43176972 languageName: node linkType: hard @@ -32205,6 +32632,18 @@ __metadata: languageName: node linkType: hard +"why-is-node-running@npm:^2.2.2": + version: 2.2.2 + resolution: "why-is-node-running@npm:2.2.2" + dependencies: + siginfo: ^2.0.0 + stackback: 0.0.2 + bin: + why-is-node-running: cli.js + checksum: 50820428f6a82dfc3cbce661570bcae9b658723217359b6037b67e495255409b4c8bc7931745f5c175df71210450464517cab32b2f7458ac9c40b4925065200a + languageName: node + linkType: hard + "wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -32286,7 +32725,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^4.0.1, write-file-atomic@npm:^4.0.2": +"write-file-atomic@npm:^4.0.2": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" dependencies: @@ -32306,7 +32745,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.8.1, ws@npm:^8.8.0": +"ws@npm:8.8.1": version: 8.8.1 resolution: "ws@npm:8.8.1" peerDependencies: From 49808189cb27c469c4b35ad78ff4e839f5caaa98 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 26 Sep 2023 23:25:30 +0800 Subject: [PATCH 09/12] Update private/js2ts/index.mjs Co-authored-by: Antoine du Hamel --- private/js2ts/index.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/private/js2ts/index.mjs b/private/js2ts/index.mjs index 42328a7c10..7763886c4b 100755 --- a/private/js2ts/index.mjs +++ b/private/js2ts/index.mjs @@ -1,5 +1,7 @@ #!/usr/bin/env node + +/** This script can be used to convert plugins with ESM source into plugins with TS source. */ import { opendir, readFile, open, writeFile, rm } from 'node:fs/promises' import { argv } from 'node:process' import { extname } from 'node:path' From 57341b6ed4dc22360194e00ca17403ffd4f3e8cd Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 26 Sep 2023 17:27:30 +0200 Subject: [PATCH 10/12] Update private/js2ts/index.mjs --- private/js2ts/index.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/private/js2ts/index.mjs b/private/js2ts/index.mjs index 7763886c4b..62ff96737e 100755 --- a/private/js2ts/index.mjs +++ b/private/js2ts/index.mjs @@ -1,7 +1,10 @@ #!/usr/bin/env node -/** This script can be used to convert plugins with ESM source into plugins with TS source. */ +/** + * This script can be used to initiate the transition for a plugin from ESM source to + * TS source. It will rename the files, update the imports, and add a `tsconfig.json`. +*/ import { opendir, readFile, open, writeFile, rm } from 'node:fs/promises' import { argv } from 'node:process' import { extname } from 'node:path' From f7c2e576b0f55a840dda30b881bb13802b81d35b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 26 Sep 2023 17:27:54 +0200 Subject: [PATCH 11/12] Update private/js2ts/index.mjs --- private/js2ts/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/js2ts/index.mjs b/private/js2ts/index.mjs index 62ff96737e..dbf850628c 100755 --- a/private/js2ts/index.mjs +++ b/private/js2ts/index.mjs @@ -1,10 +1,10 @@ #!/usr/bin/env node - /** * This script can be used to initiate the transition for a plugin from ESM source to * TS source. It will rename the files, update the imports, and add a `tsconfig.json`. */ + import { opendir, readFile, open, writeFile, rm } from 'node:fs/promises' import { argv } from 'node:process' import { extname } from 'node:path' From 6c9586e0b0d1143a4d65de87d7b235bfdc5a215b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 26 Sep 2023 17:48:23 +0200 Subject: [PATCH 12/12] Update private/js2ts/index.mjs --- private/js2ts/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/js2ts/index.mjs b/private/js2ts/index.mjs index dbf850628c..6f3134e71c 100755 --- a/private/js2ts/index.mjs +++ b/private/js2ts/index.mjs @@ -3,7 +3,7 @@ /** * This script can be used to initiate the transition for a plugin from ESM source to * TS source. It will rename the files, update the imports, and add a `tsconfig.json`. -*/ + */ import { opendir, readFile, open, writeFile, rm } from 'node:fs/promises' import { argv } from 'node:process'