diff --git a/packages/utils/jest.config.js b/packages/utils/jest.config.js deleted file mode 100644 index f9b7ccfa4502..000000000000 --- a/packages/utils/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const baseConfig = require('../../jest/jest.config.js'); - -module.exports = { - ...baseConfig, - transform: { - '^.+\\.ts$': 'ts-jest', - '^.+\\.js$': 'ts-jest', - }, -}; diff --git a/packages/utils/package.json b/packages/utils/package.json index 349cd5b03b05..853310a4a707 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -42,8 +42,7 @@ "@sentry/types": "8.20.0" }, "devDependencies": { - "@types/array.prototype.flat": "^1.2.1", - "array.prototype.flat": "^1.3.0" + "vitest": "^0.31.4" }, "scripts": { "build": "run-p build:transpile build:types", @@ -61,8 +60,8 @@ "clean": "rimraf build coverage cjs esm sentry-utils-*.tgz", "fix": "eslint . --format stylish --fix", "lint": "eslint . --format stylish", - "test": "jest", - "test:watch": "jest --watch", + "test": "vitest run", + "test:watch": "vitest --watch", "version": "node ../../scripts/versionbump.js src/version.ts", "yalc:publish": "yalc publish --push --sig" }, diff --git a/packages/utils/src/object.ts b/packages/utils/src/object.ts index 95346cf1f812..9caefb4b2e39 100644 --- a/packages/utils/src/object.ts +++ b/packages/utils/src/object.ts @@ -65,8 +65,9 @@ export function addNonEnumerableProperty(obj: object, name: string, value: unkno export function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void { try { const proto = original.prototype || {}; - wrapped.prototype = original.prototype = proto; + wrapped.prototype = proto; addNonEnumerableProperty(wrapped, '__sentry_original__', original); + original.prototype = proto; } catch (o_O) {} // eslint-disable-line no-empty } diff --git a/packages/utils/test/aggregate-errors.test.ts b/packages/utils/test/aggregate-errors.test.ts index 7cfd8e0b82da..421fe73ebd58 100644 --- a/packages/utils/test/aggregate-errors.test.ts +++ b/packages/utils/test/aggregate-errors.test.ts @@ -1,3 +1,5 @@ +import { describe, expect } from 'vitest'; + import type { Event, EventHint, Exception, ExtendedError, StackParser } from '@sentry/types'; import { applyAggregateErrorsToEvent, createStackParser } from '../src/index'; diff --git a/packages/utils/test/array.test.ts b/packages/utils/test/array.test.ts index ebf702508585..cd1dead5b40b 100644 --- a/packages/utils/test/array.test.ts +++ b/packages/utils/test/array.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import type { NestedArray } from '../src/array'; import { flatten } from '../src/array'; diff --git a/packages/utils/test/baggage.test.ts b/packages/utils/test/baggage.test.ts index 539a34e44d9c..941be640985b 100644 --- a/packages/utils/test/baggage.test.ts +++ b/packages/utils/test/baggage.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader } from '../src/baggage'; test.each([ diff --git a/packages/utils/test/browser.test.ts b/packages/utils/test/browser.test.ts index 8b92f28a8536..15ae239c7630 100644 --- a/packages/utils/test/browser.test.ts +++ b/packages/utils/test/browser.test.ts @@ -1,3 +1,5 @@ +import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; + import { JSDOM } from 'jsdom'; import { getDomElement, htmlTreeAsString } from '../src/browser'; diff --git a/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts b/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts index d2a1d98d8a05..0ce9a8144faf 100644 --- a/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts +++ b/packages/utils/test/buildPolyfills/nullishCoalesce.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { _nullishCoalesce } from '../../src/buildPolyfills'; import type { Value } from '../../src/buildPolyfills/types'; import { _nullishCoalesce as _nullishCoalesceOrig } from './originals'; diff --git a/packages/utils/test/buildPolyfills/optionalChain.test.ts b/packages/utils/test/buildPolyfills/optionalChain.test.ts index 4ad6f14befde..608a4c4bae34 100644 --- a/packages/utils/test/buildPolyfills/optionalChain.test.ts +++ b/packages/utils/test/buildPolyfills/optionalChain.test.ts @@ -1,13 +1,9 @@ -import { default as arrayFlat } from 'array.prototype.flat'; +import { describe, expect, it } from 'vitest'; import { _optionalChain } from '../../src/buildPolyfills'; import type { GenericFunction, GenericObject, Value } from '../../src/buildPolyfills/types'; import { _optionalChain as _optionalChainOrig } from './originals'; -// Older versions of Node don't have `Array.prototype.flat`, which crashes these tests. On newer versions that do have -// it, this is a no-op. -arrayFlat.shim(); - type OperationType = 'access' | 'call' | 'optionalAccess' | 'optionalCall'; type OperationExecutor = | ((intermediateValue: GenericObject) => Value) diff --git a/packages/utils/test/clientreport.test.ts b/packages/utils/test/clientreport.test.ts index 04a2a4fe7334..e6143e1228f2 100644 --- a/packages/utils/test/clientreport.test.ts +++ b/packages/utils/test/clientreport.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import type { ClientReport } from '@sentry/types'; import { createClientReportEnvelope } from '../src/clientreport'; diff --git a/packages/utils/test/cookie.test.ts b/packages/utils/test/cookie.test.ts index 2110f384c9b6..3d7156a731a0 100644 --- a/packages/utils/test/cookie.test.ts +++ b/packages/utils/test/cookie.test.ts @@ -27,6 +27,7 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +import { describe, expect, it } from 'vitest'; import { parseCookie } from '../src/cookie'; diff --git a/packages/utils/test/dsn.test.ts b/packages/utils/test/dsn.test.ts index e1aadb893e8e..2d872994ef13 100644 --- a/packages/utils/test/dsn.test.ts +++ b/packages/utils/test/dsn.test.ts @@ -1,17 +1,19 @@ +import { beforeEach, describe, expect, test, vi } from 'vitest'; + import { DEBUG_BUILD } from '../src/debug-build'; import { dsnToString, makeDsn } from '../src/dsn'; import { logger } from '../src/logger'; -function testIf(condition: boolean): jest.It { +function testIf(condition: boolean) { return condition ? test : test.skip; } -const loggerErrorSpy = jest.spyOn(logger, 'error').mockImplementation(() => {}); -const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); +const loggerErrorSpy = vi.spyOn(logger, 'error').mockImplementation(() => {}); +const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); describe('Dsn', () => { beforeEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); describe('fromComponents', () => { diff --git a/packages/utils/test/envelope.test.ts b/packages/utils/test/envelope.test.ts index fa2df9cc159a..6be93d6f96bb 100644 --- a/packages/utils/test/envelope.test.ts +++ b/packages/utils/test/envelope.test.ts @@ -1,3 +1,5 @@ +import { afterEach, describe, expect, it, test, vi } from 'vitest'; + import type { Event, EventEnvelope, SpanAttributes } from '@sentry/types'; import { @@ -108,12 +110,8 @@ describe('envelope', () => { name: 'with TextEncoder/Decoder polyfill', before: () => { GLOBAL_OBJ.__SENTRY__ = {} as InternalGlobal['__SENTRY__']; - GLOBAL_OBJ.__SENTRY__.encodePolyfill = jest.fn((input: string) => - new TextEncoder().encode(input), - ); - GLOBAL_OBJ.__SENTRY__.decodePolyfill = jest.fn((input: Uint8Array) => - new TextDecoder().decode(input), - ); + GLOBAL_OBJ.__SENTRY__.encodePolyfill = vi.fn((input: string) => new TextEncoder().encode(input)); + GLOBAL_OBJ.__SENTRY__.decodePolyfill = vi.fn((input: Uint8Array) => new TextDecoder().decode(input)); }, after: () => { expect(GLOBAL_OBJ.__SENTRY__.encodePolyfill).toHaveBeenCalled(); diff --git a/packages/utils/test/eventbuilder.test.ts b/packages/utils/test/eventbuilder.test.ts index 7c67571e753e..2baae94c6be7 100644 --- a/packages/utils/test/eventbuilder.test.ts +++ b/packages/utils/test/eventbuilder.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it, test } from 'vitest'; + import type { Client } from '@sentry/types'; import { createStackParser, eventFromUnknownInput, nodeStackLineParser } from '../src'; diff --git a/packages/utils/test/instrument/fetch.test.ts b/packages/utils/test/instrument/fetch.test.ts index ea29e0c16c3e..b07f977de520 100644 --- a/packages/utils/test/instrument/fetch.test.ts +++ b/packages/utils/test/instrument/fetch.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { parseFetchArgs } from '../../src/instrument/fetch'; describe('instrument > parseFetchArgs', () => { diff --git a/packages/utils/test/is.test.ts b/packages/utils/test/is.test.ts index 1ccfc2cd1754..40a767010cba 100644 --- a/packages/utils/test/is.test.ts +++ b/packages/utils/test/is.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it, test } from 'vitest'; + import { isDOMError, isDOMException, diff --git a/packages/utils/test/lru.test.ts b/packages/utils/test/lru.test.ts index 15f638e9cfa1..1c0b73037817 100644 --- a/packages/utils/test/lru.test.ts +++ b/packages/utils/test/lru.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { LRUMap } from '../src/lru'; describe('LRUMap', () => { diff --git a/packages/utils/test/misc.test.ts b/packages/utils/test/misc.test.ts index 14f3e88c0f0b..80769a0a7a9b 100644 --- a/packages/utils/test/misc.test.ts +++ b/packages/utils/test/misc.test.ts @@ -1,3 +1,7 @@ +import { afterEach, describe, expect, it, test, vi } from 'vitest'; + +import * as cryptoMod from 'node:crypto'; + import type { Event, Mechanism, StackFrame } from '@sentry/types'; import { @@ -6,9 +10,26 @@ import { arrayify, checkOrSetAlreadyCaught, getEventDescription, + parseSemver, uuid4, } from '../src/misc'; +const NODE_VERSION = parseSemver(process.versions.node); +/** + * Returns`describe` or `describe.skip` depending on allowed major versions of Node. + * + * @param {{ min?: number; max?: number }} allowedVersion + */ +export const conditionalTest = (allowedVersion: { min?: number; max?: number }) => { + if (!NODE_VERSION) { + return test.skip; + } + + return NODE_VERSION < (allowedVersion.min || -Infinity) || NODE_VERSION > (allowedVersion.max || Infinity) + ? test.skip + : test; +}; + describe('getEventDescription()', () => { test('message event', () => { expect( @@ -290,6 +311,10 @@ describe('checkOrSetAlreadyCaught()', () => { }); describe('uuid4 generation', () => { + afterEach(() => { + vi.unstubAllGlobals(); + }); + const uuid4Regex = /^[0-9A-F]{12}[4][0-9A-F]{3}[89AB][0-9A-F]{15}$/i; // Jest messes with the global object, so there is no global crypto object in any node version // For this reason we need to create our own crypto object for each test to cover all the code paths @@ -299,11 +324,8 @@ describe('uuid4 generation', () => { } }); - it('returns valid uuid v4 ids via crypto.getRandomValues', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const cryptoMod = require('crypto'); - - (global as any).crypto = { getRandomValues: cryptoMod.getRandomValues }; + conditionalTest({ min: 17 })('returns valid uuid v4 ids via crypto.getRandomValues', () => { + vi.stubGlobal('crypto', { getRandomValues: (cryptoMod as any).getRandomValues }); for (let index = 0; index < 1_000; index++) { expect(uuid4()).toMatch(uuid4Regex); @@ -311,10 +333,7 @@ describe('uuid4 generation', () => { }); it('returns valid uuid v4 ids via crypto.randomUUID', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const cryptoMod = require('crypto'); - - (global as any).crypto = { randomUUID: cryptoMod.randomUUID }; + vi.stubGlobal('crypto', { getRandomValues: cryptoMod.randomUUID }); for (let index = 0; index < 1_000; index++) { expect(uuid4()).toMatch(uuid4Regex); @@ -322,7 +341,7 @@ describe('uuid4 generation', () => { }); it("return valid uuid v4 even if crypto doesn't exists", () => { - (global as any).crypto = { getRandomValues: undefined, randomUUID: undefined }; + vi.stubGlobal('crypto', { getRandomValues: undefined, randomUUID: undefined }); for (let index = 0; index < 1_000; index++) { expect(uuid4()).toMatch(uuid4Regex); @@ -330,14 +349,14 @@ describe('uuid4 generation', () => { }); it('return valid uuid v4 even if crypto invoked causes an error', () => { - (global as any).crypto = { + vi.stubGlobal('crypto', { getRandomValues: () => { throw new Error('yo'); }, randomUUID: () => { throw new Error('yo'); }, - }; + }); for (let index = 0; index < 1_000; index++) { expect(uuid4()).toMatch(uuid4Regex); @@ -346,22 +365,22 @@ describe('uuid4 generation', () => { // Corner case related to crypto.getRandomValues being only // semi-implemented (e.g. Chromium 23.0.1235.0 (151422)) - it('returns valid uuid v4 even if crypto.getRandomValues does not return a typed array', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const cryptoMod = require('crypto'); - - const getRandomValues = (typedArray: Uint8Array) => { - if (cryptoMod.getRandomValues) { - cryptoMod.getRandomValues(typedArray); + conditionalTest({ min: 17 })( + 'returns valid uuid v4 even if crypto.getRandomValues does not return a typed array', + () => { + const getRandomValues = (typedArray: Uint8Array) => { + if ((cryptoMod as any).getRandomValues) { + (cryptoMod as any).getRandomValues(typedArray); + } + }; + + vi.stubGlobal('crypto', { getRandomValues }); + + for (let index = 0; index < 1_000; index++) { + expect(uuid4()).toMatch(uuid4Regex); } - }; - - (global as any).crypto = { getRandomValues }; - - for (let index = 0; index < 1_000; index++) { - expect(uuid4()).toMatch(uuid4Regex); - } - }); + }, + ); }); describe('arrayify()', () => { diff --git a/packages/utils/test/normalize-url.test.ts b/packages/utils/test/normalize-url.test.ts index 5df2bb5d6e35..414950ff0c70 100644 --- a/packages/utils/test/normalize-url.test.ts +++ b/packages/utils/test/normalize-url.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { normalizeUrlToBase } from '../src/normalize'; describe('normalizeUrlToBase()', () => { diff --git a/packages/utils/test/normalize.test.ts b/packages/utils/test/normalize.test.ts index 5a2414d52e43..5bd3626ad821 100644 --- a/packages/utils/test/normalize.test.ts +++ b/packages/utils/test/normalize.test.ts @@ -1,7 +1,9 @@ /** - * @jest-environment jsdom + * @vitest-environment jsdom */ +import { describe, expect, test, vi } from 'vitest'; + import * as isModule from '../src/is'; import { normalize } from '../src/normalize'; import { addNonEnumerableProperty } from '../src/object'; @@ -49,8 +51,8 @@ describe('normalize()', () => { }); }); - describe('extracts data from `Event` objects', () => { - const isElement = jest.spyOn(isModule, 'isElement').mockReturnValue(true); + test('extracts data from `Event` objects', () => { + const isElement = vi.spyOn(isModule, 'isElement').mockReturnValue(true); const getAttribute = () => undefined; const parkElement = { tagName: 'PARK', getAttribute }; @@ -593,7 +595,7 @@ describe('normalize()', () => { describe('handles serialization errors', () => { test('restricts effect of error to problematic node', () => { - jest.spyOn(stacktraceModule, 'getFunctionName').mockImplementationOnce(() => { + vi.spyOn(stacktraceModule, 'getFunctionName').mockImplementationOnce(() => { throw new Error('Nope'); }); diff --git a/packages/utils/test/object.test.ts b/packages/utils/test/object.test.ts index 2ba5a6c58fa3..605cacdccd6a 100644 --- a/packages/utils/test/object.test.ts +++ b/packages/utils/test/object.test.ts @@ -1,6 +1,4 @@ -/** - * @jest-environment jsdom - */ +import { describe, expect, it, test, vi } from 'vitest'; import type { WrappedFunction } from '@sentry/types'; @@ -13,7 +11,6 @@ import { objectify, urlEncode, } from '../src/object'; -import { testOnlyIfNodeVersionAtLeast } from './testutils'; describe('fill()', () => { test('wraps a method by calling a replacement function on it', () => { @@ -23,7 +20,7 @@ describe('fill()', () => { }, }; const name = 'foo'; - const replacement = jest.fn().mockImplementationOnce(cb => cb); + const replacement = vi.fn().mockImplementationOnce(cb => cb); fill(source, name, replacement); @@ -36,7 +33,7 @@ describe('fill()', () => { foo: (): number => 42, }; const name = 'foo'; - const replacement = jest.fn().mockImplementationOnce(cb => { + const replacement = vi.fn().mockImplementationOnce(cb => { expect(cb).toBe(source.foo); return () => 1337; }); @@ -53,12 +50,12 @@ describe('fill()', () => { foo: (): number => 42, }; const name = 'foo'; - const replacement = jest.fn().mockImplementationOnce(cb => { + const replacement = vi.fn().mockImplementationOnce(cb => { expect(cb).toBe(source.foo); return () => 1337; }); - const replacement2 = jest.fn().mockImplementationOnce(cb => { + const replacement2 = vi.fn().mockImplementationOnce(cb => { expect(cb).toBe(source.foo); return () => 1338; }); @@ -307,37 +304,18 @@ describe('objectify()', () => { }); describe('wraps other primitives with their respective object wrapper classes', () => { - // TODO: There's currently a bug in Jest - if you give it the `Boolean` class, it runs `typeof received === - // 'boolean'` but not `received instanceof Boolean` (the way it correctly does for other primitive wrappers, like - // `Number` and `String). (See https://github.com/facebook/jest/pull/11976.) Once that is fixed and we upgrade jest, - // we can comment the test below back in. (The tests for symbols and bigints are working only because our current - // version of jest is sufficiently old that they're not even considered in the relevant check and just fall to the - // default `instanceof` check jest uses for all unknown classes.) - it.each([ ['number', Number, 1121], ['string', String, 'Dogs are great!'], - // ["boolean", Boolean, true], + ['boolean', Boolean, true], ['symbol', Symbol, Symbol('Maisey')], + ['bigint', BigInt, 1231n], ])('%s', (_caseName, wrapperClass, primitive) => { const objectifiedPrimitive = objectify(primitive); expect(objectifiedPrimitive).toEqual(expect.any(wrapperClass)); expect(objectifiedPrimitive.valueOf()).toEqual(primitive); }); - - // `BigInt` doesn't exist in Node < 10, so we test it separately here. - testOnlyIfNodeVersionAtLeast(10)('bigint', () => { - // Hack to get around the fact that literal bigints cause a syntax error in older versions of Node, so the - // assignment needs to not even be parsed as code in those versions - let bigintPrimitive; - eval('bigintPrimitive = 1231n;'); - - const objectifiedBigInt = objectify(bigintPrimitive); - - expect(objectifiedBigInt).toEqual(expect.any(BigInt)); - expect(objectifiedBigInt.valueOf()).toEqual(bigintPrimitive); - }); }); it('leaves objects alone', () => { @@ -366,7 +344,7 @@ describe('addNonEnumerableProperty', () => { }); it('works with a function', () => { - const func = jest.fn(); + const func = vi.fn(); addNonEnumerableProperty(func as any, 'foo', 'bar'); expect((func as any).foo).toBe('bar'); func(); @@ -401,8 +379,8 @@ describe('addNonEnumerableProperty', () => { describe('markFunctionWrapped', () => { it('works with a function', () => { - const originalFunc = jest.fn(); - const wrappedFunc = jest.fn(); + const originalFunc = vi.fn(); + const wrappedFunc = vi.fn(); markFunctionWrapped(wrappedFunc, originalFunc); expect((wrappedFunc as WrappedFunction).__sentry_original__).toBe(originalFunc); @@ -414,8 +392,8 @@ describe('markFunctionWrapped', () => { }); it('works with a frozen original function', () => { - const originalFunc = Object.freeze(jest.fn()); - const wrappedFunc = jest.fn(); + const originalFunc = Object.freeze(vi.fn()); + const wrappedFunc = vi.fn(); markFunctionWrapped(wrappedFunc, originalFunc); expect((wrappedFunc as WrappedFunction).__sentry_original__).toBe(originalFunc); @@ -427,8 +405,8 @@ describe('markFunctionWrapped', () => { }); it('works with a frozen wrapped function', () => { - const originalFunc = Object.freeze(jest.fn()); - const wrappedFunc = Object.freeze(jest.fn()); + const originalFunc = Object.freeze(vi.fn()); + const wrappedFunc = Object.freeze(vi.fn()); markFunctionWrapped(wrappedFunc, originalFunc); // Skips adding the property, but also doesn't error diff --git a/packages/utils/test/path.test.ts b/packages/utils/test/path.test.ts index 3ba750830f1b..6b21c23df533 100644 --- a/packages/utils/test/path.test.ts +++ b/packages/utils/test/path.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { basename, dirname } from '../src/path'; describe('path', () => { diff --git a/packages/utils/test/proagationContext.test.ts b/packages/utils/test/proagationContext.test.ts index 01c8569bde9b..88f2a69152df 100644 --- a/packages/utils/test/proagationContext.test.ts +++ b/packages/utils/test/proagationContext.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { generatePropagationContext } from '../src/propagationContext'; describe('generatePropagationContext', () => { diff --git a/packages/utils/test/promisebuffer.test.ts b/packages/utils/test/promisebuffer.test.ts index 1dc2e1f993e8..ecbe89aadf8c 100644 --- a/packages/utils/test/promisebuffer.test.ts +++ b/packages/utils/test/promisebuffer.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test, vi } from 'vitest'; + import { makePromiseBuffer } from '../src/promisebuffer'; import { SyncPromise } from '../src/syncpromise'; @@ -5,7 +7,7 @@ describe('PromiseBuffer', () => { describe('add()', () => { test('no limit', () => { const buffer = makePromiseBuffer(); - const p = jest.fn(() => new SyncPromise(resolve => setTimeout(resolve))); + const p = vi.fn(() => new SyncPromise(resolve => setTimeout(resolve))); void buffer.add(p); expect(buffer.$.length).toEqual(1); }); @@ -13,11 +15,11 @@ describe('PromiseBuffer', () => { test('with limit', () => { const buffer = makePromiseBuffer(1); let task1; - const producer1 = jest.fn(() => { + const producer1 = vi.fn(() => { task1 = new SyncPromise(resolve => setTimeout(resolve)); return task1; }); - const producer2 = jest.fn(() => new SyncPromise(resolve => setTimeout(resolve))); + const producer2 = vi.fn(() => new SyncPromise(resolve => setTimeout(resolve))); expect(buffer.add(producer1)).toEqual(task1); void expect(buffer.add(producer2)).rejects.toThrowError(); expect(buffer.$.length).toEqual(1); diff --git a/packages/utils/test/ratelimit.test.ts b/packages/utils/test/ratelimit.test.ts index 5833548727f7..ba93d5d73507 100644 --- a/packages/utils/test/ratelimit.test.ts +++ b/packages/utils/test/ratelimit.test.ts @@ -1,4 +1,7 @@ +import { describe, expect, test } from 'vitest'; + import type { RateLimits } from '../src/ratelimit'; + import { DEFAULT_RETRY_AFTER, disabledUntil, diff --git a/packages/utils/test/requestdata.test.ts b/packages/utils/test/requestdata.test.ts index 7e44f703c62a..23e71d50886b 100644 --- a/packages/utils/test/requestdata.test.ts +++ b/packages/utils/test/requestdata.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it, test } from 'vitest'; + import type * as net from 'net'; import type { Event, PolymorphicRequest, TransactionSource, User } from '@sentry/types'; import { addRequestDataToEvent, extractPathForTransaction, extractRequestData } from '@sentry/utils'; diff --git a/packages/utils/test/severity.test.ts b/packages/utils/test/severity.test.ts index 51f66e815288..8f2365c6e716 100644 --- a/packages/utils/test/severity.test.ts +++ b/packages/utils/test/severity.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { severityLevelFromString, validSeverityLevels } from '../src/severity'; describe('severityLevelFromString()', () => { diff --git a/packages/utils/test/stacktrace.test.ts b/packages/utils/test/stacktrace.test.ts index f1ef0454a71a..057c861c91d2 100644 --- a/packages/utils/test/stacktrace.test.ts +++ b/packages/utils/test/stacktrace.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest'; + import { nodeStackLineParser, stripSentryFramesAndReverse } from '../src'; describe('Stacktrace', () => { @@ -118,7 +120,7 @@ describe('Stacktrace', () => { }); describe('node', () => { - const mockGetModule = jest.fn(); + const mockGetModule = vi.fn(); const parser = nodeStackLineParser(mockGetModule); const node = parser[1]; diff --git a/packages/utils/test/string.test.ts b/packages/utils/test/string.test.ts index bb49a7833a11..470469245378 100644 --- a/packages/utils/test/string.test.ts +++ b/packages/utils/test/string.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { isMatchingPattern, stringMatchesSomePattern, truncate } from '../src/string'; describe('truncate()', () => { diff --git a/packages/utils/test/syncpromise.test.ts b/packages/utils/test/syncpromise.test.ts index 53dff943fa48..54dcd2057dda 100644 --- a/packages/utils/test/syncpromise.test.ts +++ b/packages/utils/test/syncpromise.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test, vi } from 'vitest'; + import { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from '../src/syncpromise'; describe('SyncPromise', () => { @@ -120,14 +122,14 @@ describe('SyncPromise', () => { }); test('with setTimeout', async () => { - jest.useFakeTimers(); + vi.useFakeTimers(); expect.assertions(1); return new SyncPromise(resolve => { setTimeout(() => { resolve(12); }, 10); - jest.runAllTimers(); + vi.runAllTimers(); }).then(val => { expect(val).toEqual(12); }); @@ -146,7 +148,7 @@ describe('SyncPromise', () => { }); test('calling the callback not immediatly', () => { - jest.useFakeTimers(); + vi.useFakeTimers(); expect.assertions(4); const qp = new SyncPromise(resolve => @@ -169,7 +171,7 @@ describe('SyncPromise', () => { .then(null, () => { // no-empty }); - jest.runAllTimers(); + vi.runAllTimers(); expect(qp).toHaveProperty('_value'); }); diff --git a/packages/utils/test/testutils.ts b/packages/utils/test/testutils.ts deleted file mode 100644 index 6130ee7ca365..000000000000 --- a/packages/utils/test/testutils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const testOnlyIfNodeVersionAtLeast = (minVersion: number): jest.It => { - const currentNodeVersion = process.env.NODE_VERSION; - - try { - if (Number(currentNodeVersion?.split('.')[0]) < minVersion) { - return it.skip; - } - } catch (oO) { - // we can't tell, so err on the side of running the test - } - - return it; -}; diff --git a/packages/utils/test/tracing.test.ts b/packages/utils/test/tracing.test.ts index 399c37104445..796504d11d95 100644 --- a/packages/utils/test/tracing.test.ts +++ b/packages/utils/test/tracing.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it, test } from 'vitest'; + import { extractTraceparentData, propagationContextFromHeaders } from '../src/tracing'; const EXAMPLE_SENTRY_TRACE = '12312012123120121231201212312012-1121201211212012-1'; diff --git a/packages/utils/test/types/typedef.test.ts b/packages/utils/test/types/typedef.test.ts index 45719e13181c..61d3afc0d9a4 100644 --- a/packages/utils/test/types/typedef.test.ts +++ b/packages/utils/test/types/typedef.test.ts @@ -1,3 +1,5 @@ +import { test } from 'vitest'; + import * as fs from 'node:fs'; import * as path from 'node:path'; diff --git a/packages/utils/test/url.test.ts b/packages/utils/test/url.test.ts index d58f7cf205a8..6118a95bf20b 100644 --- a/packages/utils/test/url.test.ts +++ b/packages/utils/test/url.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it, test } from 'vitest'; + import { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '../src/url'; describe('stripQueryStringAndFragment', () => { diff --git a/packages/utils/test/worldwide.test.ts b/packages/utils/test/worldwide.test.ts index 3b85eb06fdd1..c1161fc75def 100644 --- a/packages/utils/test/worldwide.test.ts +++ b/packages/utils/test/worldwide.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, test } from 'vitest'; + import { GLOBAL_OBJ } from '../src/worldwide'; describe('GLOBAL_OBJ', () => { diff --git a/packages/utils/tsconfig.test.json b/packages/utils/tsconfig.test.json index 0f755903fa64..580dbcc6d564 100644 --- a/packages/utils/tsconfig.test.json +++ b/packages/utils/tsconfig.test.json @@ -1,11 +1,11 @@ { "extends": "./tsconfig.json", - "include": ["test/**/*"], + "include": ["test/**/*", "vite.config.ts"], "compilerOptions": { // should include all types from `./tsconfig.json` plus types for all test frameworks used - "types": ["node", "jest"], + "types": ["node"], // other package-specific, test-specific options // this is necessary in order to be able to handle the buildPolyfills `originals.js` which is used for testing diff --git a/packages/utils/vite.config.ts b/packages/utils/vite.config.ts new file mode 100644 index 000000000000..0582a58f479a --- /dev/null +++ b/packages/utils/vite.config.ts @@ -0,0 +1,5 @@ +import baseConfig from '../../vite/vite.config'; + +export default { + ...baseConfig, +}; diff --git a/yarn.lock b/yarn.lock index 72d28fc8f600..a00bf3787282 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9058,11 +9058,6 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== -"@types/array.prototype.flat@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#5433a141730f8e1d7a8e7486458ceb8144ee5edc" - integrity sha512-JOvNJUU/zjfJWcA1aHDnCKHwQjZ7VQ3UNfbcMKXrkQKKyMkJHrQ9vpSVMhgsztrtsbIRJKazMDvg2QggFVwJqw== - "@types/aws-lambda@8.10.122", "@types/aws-lambda@^8.10.62": version "8.10.122" resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.122.tgz#206c8d71b09325d26a458dba27db842afdc54df1" @@ -9159,11 +9154,23 @@ dependencies: "@types/chai" "*" +"@types/chai-subset@^1.3.3": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.5.tgz#3fc044451f26985f45625230a7f22284808b0a9a" + integrity sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A== + dependencies: + "@types/chai" "*" + "@types/chai@*", "@types/chai@^4.2.9": version "4.2.15" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553" integrity sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ== +"@types/chai@^4.3.5": + version "4.3.16" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.16.tgz#b1572967f0b8b60bf3f87fe1d854a5604ea70c82" + integrity sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ== + "@types/connect-history-api-fallback@^1.3.5": version "1.5.4" resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz#7de71645a103056b48ac3ce07b3520b819c1d5b3" @@ -10398,6 +10405,15 @@ strip-literal "^2.0.0" test-exclude "^6.0.0" +"@vitest/expect@0.31.4": + version "0.31.4" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.31.4.tgz#115c517404488bf3cb6ce4ac411c40d8e86891b8" + integrity sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg== + dependencies: + "@vitest/spy" "0.31.4" + "@vitest/utils" "0.31.4" + chai "^4.3.7" + "@vitest/expect@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.6.0.tgz#0b3ba0914f738508464983f4d811bc122b51fb30" @@ -10407,6 +10423,16 @@ "@vitest/utils" "1.6.0" chai "^4.3.10" +"@vitest/runner@0.31.4": + version "0.31.4" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.31.4.tgz#e99abee89132a500d9726a53b58dfc9160db1078" + integrity sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg== + dependencies: + "@vitest/utils" "0.31.4" + concordance "^5.0.4" + p-limit "^4.0.0" + pathe "^1.1.0" + "@vitest/runner@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-1.6.0.tgz#a6de49a96cb33b0e3ba0d9064a3e8d6ce2f08825" @@ -10416,6 +10442,15 @@ p-limit "^5.0.0" pathe "^1.1.1" +"@vitest/snapshot@0.31.4": + version "0.31.4" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.31.4.tgz#59a42046fec4950a1ac70cf0ec64aada3b995559" + integrity sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA== + dependencies: + magic-string "^0.30.0" + pathe "^1.1.0" + pretty-format "^27.5.1" + "@vitest/snapshot@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-1.6.0.tgz#deb7e4498a5299c1198136f56e6e0f692e6af470" @@ -10425,6 +10460,13 @@ pathe "^1.1.1" pretty-format "^29.7.0" +"@vitest/spy@0.31.4": + version "0.31.4" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.31.4.tgz#fce8e348cea32deff79996d116c67893b19cc47d" + integrity sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag== + dependencies: + tinyspy "^2.1.0" + "@vitest/spy@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-1.6.0.tgz#362cbd42ccdb03f1613798fde99799649516906d" @@ -10432,6 +10474,15 @@ dependencies: tinyspy "^2.2.0" +"@vitest/utils@0.31.4": + version "0.31.4" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.31.4.tgz#5cfdcecfd604a7dbe3972cfe0f2b1e0af1246ad2" + integrity sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ== + dependencies: + concordance "^5.0.4" + loupe "^2.3.6" + pretty-format "^27.5.1" + "@vitest/utils@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-1.6.0.tgz#5c5675ca7d6f546a7b4337de9ae882e6c57896a1" @@ -11870,7 +11921,7 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -array.prototype.flat@^1.2.3, array.prototype.flat@^1.3.0: +array.prototype.flat@^1.2.3: version "1.3.0" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== @@ -12691,6 +12742,11 @@ bluebird@^3.4.6, bluebird@^3.7.2: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== +blueimp-md5@^2.10.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz#b53feea5498dcb53dc6ec4b823adb84b729c4af0" + integrity sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w== + body-parser@1.20.1, body-parser@^1.18.3, body-parser@^1.19.0: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" @@ -13804,6 +13860,19 @@ chai@^4.3.10: pathval "^1.1.1" type-detect "^4.0.8" +chai@^4.3.7: + version "4.5.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.5.0.tgz#707e49923afdd9b13a8b0b47d33d732d13812fd8" + integrity sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.1.0" + chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -14434,6 +14503,20 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" +concordance@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2" + integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw== + dependencies: + date-time "^3.1.0" + esutils "^2.0.3" + fast-diff "^1.2.0" + js-string-escape "^1.0.1" + lodash "^4.17.15" + md5-hex "^3.0.1" + semver "^7.3.2" + well-known-symbols "^2.0.0" + confbox@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.7.tgz#ccfc0a2bcae36a84838e83a3b7f770fb17d6c579" @@ -15138,6 +15221,13 @@ date-fns@^3.6.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== +date-time@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e" + integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg== + dependencies: + time-zone "^1.0.0" + dateformat@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -17764,7 +17854,7 @@ estree-walker@^3.0.0, estree-walker@^3.0.3: dependencies: "@types/estree" "^1.0.0" -esutils@^2.0.2: +esutils@^2.0.2, esutils@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -18085,6 +18175,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-diff@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + fast-fifo@^1.1.0, fast-fifo@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" @@ -23495,6 +23590,13 @@ md5-file@^5.0.0: resolved "https://registry.yarnpkg.com/md5-file/-/md5-file-5.0.0.tgz#e519f631feca9c39e7f9ea1780b63c4745012e20" integrity sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw== +md5-hex@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c" + integrity sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw== + dependencies: + blueimp-md5 "^2.10.0" + mdast-util-definitions@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz#9910abb60ac5d7115d6819b57ae0bcef07a3f7a7" @@ -30698,7 +30800,7 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -std-env@^3.5.0, std-env@^3.7.0: +std-env@^3.3.2, std-env@^3.5.0, std-env@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== @@ -30999,6 +31101,13 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-literal@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.3.0.tgz#db3942c2ec1699e6836ad230090b84bb458e3a07" + integrity sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg== + dependencies: + acorn "^8.10.0" + strip-literal@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-2.0.0.tgz#5d063580933e4e03ebb669b12db64d2200687527" @@ -31571,6 +31680,11 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== +time-zone@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d" + integrity sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA== + timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" @@ -31611,17 +31725,27 @@ tiny-warning@^1.0.0: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== +tinybench@^2.5.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.8.0.tgz#30e19ae3a27508ee18273ffed9ac7018949acd7b" + integrity sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw== + tinybench@^2.5.1: version "2.6.0" resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.6.0.tgz#1423284ee22de07c91b3752c048d2764714b341b" integrity sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA== +tinypool@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.5.0.tgz#3861c3069bf71e4f1f5aa2d2e6b3aaacc278961e" + integrity sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ== + tinypool@^0.8.3: version "0.8.4" resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.8.4.tgz#e217fe1270d941b39e98c625dcecebb1408c9aa8" integrity sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ== -tinyspy@^2.2.0: +tinyspy@^2.1.0, tinyspy@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.1.tgz#117b2342f1f38a0dbdcc73a50a454883adf861d1" integrity sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A== @@ -31989,6 +32113,11 @@ type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-detect@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.1.0.tgz#deb2453e8f08dcae7ae98c626b13dddb0155906c" + integrity sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw== + type-fest@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" @@ -32971,6 +33100,18 @@ vite-hot-client@^0.2.3: resolved "https://registry.yarnpkg.com/vite-hot-client/-/vite-hot-client-0.2.3.tgz#db52aba46edbcfa7906dbca8255fd35b9a9270b2" integrity sha512-rOGAV7rUlUHX89fP2p2v0A2WWvV3QMX2UYq0fRqsWSvFvev4atHWqjwGoKaZT1VTKyLGk533ecu3eyd0o59CAg== +vite-node@0.31.4: + version "0.31.4" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.31.4.tgz#0437f76c35fa83f0a868d3fb5896ca9e164291f5" + integrity sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + mlly "^1.2.0" + pathe "^1.1.0" + picocolors "^1.0.0" + vite "^3.0.0 || ^4.0.0" + vite-node@1.6.0, vite-node@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-1.6.0.tgz#2c7e61129bfecc759478fa592754fd9704aaba7f" @@ -33059,7 +33200,7 @@ vite-plugin-vue-inspector@^5.1.0: kolorist "^1.8.0" magic-string "^0.30.4" -vite@4.5.3: +vite@4.5.3, "vite@^3.0.0 || ^4.0.0": version "4.5.3" resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a" integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg== @@ -33135,6 +33276,37 @@ vitefu@^0.2.4: resolved "https://registry.yarnpkg.com/vitefu/-/vitefu-0.2.4.tgz#212dc1a9d0254afe65e579351bed4e25d81e0b35" integrity sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g== +vitest@^0.31.4: + version "0.31.4" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.31.4.tgz#5abe02562675262949c10e40811f348a80f6b2a6" + integrity sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ== + dependencies: + "@types/chai" "^4.3.5" + "@types/chai-subset" "^1.3.3" + "@types/node" "*" + "@vitest/expect" "0.31.4" + "@vitest/runner" "0.31.4" + "@vitest/snapshot" "0.31.4" + "@vitest/spy" "0.31.4" + "@vitest/utils" "0.31.4" + acorn "^8.8.2" + acorn-walk "^8.2.0" + cac "^6.7.14" + chai "^4.3.7" + concordance "^5.0.4" + debug "^4.3.4" + local-pkg "^0.4.3" + magic-string "^0.30.0" + pathe "^1.1.0" + picocolors "^1.0.0" + std-env "^3.3.2" + strip-literal "^1.0.1" + tinybench "^2.5.0" + tinypool "^0.5.0" + vite "^3.0.0 || ^4.0.0" + vite-node "0.31.4" + why-is-node-running "^2.2.2" + vitest@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/vitest/-/vitest-1.6.0.tgz#9d5ad4752a3c451be919e412c597126cffb9892f" @@ -33636,6 +33808,11 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== +well-known-symbols@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5" + integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q== + whatwg-encoding@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0"