From 1474990b96d3458520f97dcdae6a5107837cbd33 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 15:54:47 +0800 Subject: [PATCH 01/39] feat(expect): support `expect.soft` --- packages/expect/src/jest-expect.ts | 6 +- packages/expect/src/jest-extend.ts | 5 +- packages/expect/src/types.ts | 3 +- packages/expect/src/utils.ts | 26 ++ packages/runner/src/run.ts | 42 ++-- packages/runner/src/types/tasks.ts | 2 +- .../vitest/src/integrations/chai/index.ts | 10 +- .../test/__snapshots__/expect.test.ts.snap | 233 ++++++++++++++++++ test/core/test/expect.test.ts | 50 ++++ test/core/test/fixtures/expects/soft.test.ts | 64 +++++ test/core/vitest.config.ts | 3 +- 11 files changed, 414 insertions(+), 30 deletions(-) create mode 100644 test/core/test/__snapshots__/expect.test.ts.snap create mode 100644 test/core/test/expect.test.ts create mode 100644 test/core/test/fixtures/expects/soft.test.ts diff --git a/packages/expect/src/jest-expect.ts b/packages/expect/src/jest-expect.ts index 424554546c14..07a04e88d2cf 100644 --- a/packages/expect/src/jest-expect.ts +++ b/packages/expect/src/jest-expect.ts @@ -8,7 +8,7 @@ import { arrayBufferEquality, generateToBeMessage, iterableEquality, equals as j import type { AsymmetricMatcher } from './jest-asymmetric-matchers' import { diff, stringify } from './jest-matcher-utils' import { JEST_MATCHERS_OBJECT } from './constants' -import { recordAsyncExpect } from './utils' +import { recordAsyncExpect, wrapSoft } from './utils' // Jest Expect Compact export const JestChaiExpect: ChaiPlugin = (chai, utils) => { @@ -16,8 +16,8 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => { function def(name: keyof Assertion | (keyof Assertion)[], fn: ((this: Chai.AssertionStatic & Assertion, ...args: any[]) => any)) { const addMethod = (n: keyof Assertion) => { - utils.addMethod(chai.Assertion.prototype, n, fn) - utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, n, fn) + utils.addMethod(chai.Assertion.prototype, n, wrapSoft(utils, fn)) + utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, n, wrapSoft(utils, fn)) } if (Array.isArray(name)) diff --git a/packages/expect/src/jest-extend.ts b/packages/expect/src/jest-extend.ts index 4fd9e6378033..9b1fd9f438a4 100644 --- a/packages/expect/src/jest-extend.ts +++ b/packages/expect/src/jest-extend.ts @@ -17,6 +17,7 @@ import { iterableEquality, subsetEquality, } from './jest-utils' +import { wrapSoft } from './utils' function getMatcherState(assertion: Chai.AssertionStatic & Chai.Assertion, expect: ExpectStatic) { const obj = assertion._obj @@ -75,8 +76,8 @@ function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiP throw new JestExtendError(message(), actual, expected) } - utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, expectWrapper) - utils.addMethod(c.Assertion.prototype, expectAssertionName, expectWrapper) + utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, wrapSoft(utils, expectWrapper)) + utils.addMethod(c.Assertion.prototype, expectAssertionName, wrapSoft(utils, expectWrapper)) class CustomMatcher extends AsymmetricMatcher<[unknown, ...unknown[]]> { constructor(inverse = false, ...sample: [unknown, ...unknown[]]) { diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts index 78d5d0533166..f1d40f5446af 100644 --- a/packages/expect/src/types.ts +++ b/packages/expect/src/types.ts @@ -79,6 +79,7 @@ export interface MatcherState { iterableEquality: Tester subsetEquality: Tester } + soft?: boolean } export interface SyncExpectationResult { @@ -100,7 +101,7 @@ export type MatchersObject = Record(actual: T, message?: string): Assertion - + soft: (actual: T, message?: string) => Assertion extend(expects: MatchersObject): void assertions(expected: number): void hasAssertions(): void diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index 1201f5a90b12..fb29db2e1724 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -1,3 +1,7 @@ +import { GLOBAL_EXPECT } from './constants' +import { getState } from './state' +import type { Assertion, MatcherState } from './types' + export function recordAsyncExpect(test: any, promise: Promise | PromiseLike) { // record promise for test, that resolves before test ends if (test && promise instanceof Promise) { @@ -16,3 +20,25 @@ export function recordAsyncExpect(test: any, promise: Promise | PromiseLike return promise } + +export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic & Assertion, ...args: any[]) => void) { + return function (this: Chai.AssertionStatic & Assertion, ...args: any[]) { + const test = utils.flag(this, 'vitest-test') + + const state: MatcherState = test?.context._local + ? test.context.expect.getState() + : getState((globalThis as any)[GLOBAL_EXPECT]) + + if (!state.soft) + return fn.apply(this, args) + + try { + return fn.apply(this, args) + } + catch (err) { + test.result.state = 'softFail' + test.result.errors ||= [] + test.result.errors.push(err) + } + } +} diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index 70e9e75e7cad..b540d34ee726 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -156,21 +156,25 @@ export async function runTest(test: Test, runner: VitestRunner) { throw new Error('Test function is not found. Did you add it using `setFn`?') await fn() } - - // some async expect will be added to this array, in case user forget to await theme - if (test.promises) { - const result = await Promise.allSettled(test.promises) - const errors = result.map(r => r.status === 'rejected' ? r.reason : undefined).filter(Boolean) - if (errors.length) - throw errors + if (test.result.state === 'softFail') { + failTask(test.result, []) } + else { + // some async expect will be added to this array, in case user forget to await theme + if (test.promises) { + const result = await Promise.allSettled(test.promises) + const errors = result.map(r => r.status === 'rejected' ? r.reason : undefined).filter(Boolean) + if (errors.length) + throw errors + } - await runner.onAfterTryTest?.(test, { retry: retryCount, repeats: repeatCount }) + await runner.onAfterTryTest?.(test, { retry: retryCount, repeats: repeatCount }) - if (!test.repeats) - test.result.state = 'pass' - else if (test.repeats && retry === retryCount) - test.result.state = 'pass' + if (!test.repeats) + test.result.state = 'pass' + else if (test.repeats && retry === retryCount) + test.result.state = 'pass' + } } catch (e) { failTask(test.result, e) @@ -220,15 +224,11 @@ export async function runTest(test: Test, runner: VitestRunner) { function failTask(result: TaskResult, err: unknown) { result.state = 'fail' - const errors = Array.isArray(err) - ? err - : [err] - for (const e of errors) { - const error = processError(e) - result.error ??= error - result.errors ??= [] - result.errors.push(error) - } + const errors = Array.isArray(err) ? err : [err] + result.errors = [...result.errors || [], ...errors].map(err => processError(err)) + const errorsLength = result.errors.length + if (errorsLength > 0) + result.error = result.errors[errorsLength - 1] } function markTasksAsSkipped(suite: Suite, runner: VitestRunner) { diff --git a/packages/runner/src/types/tasks.ts b/packages/runner/src/types/tasks.ts index 7ff9c4e4b7b1..139357e446a7 100644 --- a/packages/runner/src/types/tasks.ts +++ b/packages/runner/src/types/tasks.ts @@ -3,7 +3,7 @@ import type { ChainableFunction } from '../utils/chain' import type { ErrorWithDiff } from '../utils/error' export type RunMode = 'run' | 'skip' | 'only' | 'todo' -export type TaskState = RunMode | 'pass' | 'fail' +export type TaskState = RunMode | 'pass' | 'fail' | 'softFail' export interface TaskBase { id: string diff --git a/packages/vitest/src/integrations/chai/index.ts b/packages/vitest/src/integrations/chai/index.ts index 01ed3d84d22d..941374d19e97 100644 --- a/packages/vitest/src/integrations/chai/index.ts +++ b/packages/vitest/src/integrations/chai/index.ts @@ -12,7 +12,7 @@ import { getCurrentEnvironment, getFullName } from '../../utils' export function createExpect(test?: Test) { const expect = ((value: any, message?: string): Assertion => { const { assertionCalls } = getState(expect) - setState({ assertionCalls: assertionCalls + 1 }, expect) + setState({ assertionCalls: assertionCalls + 1, soft: false }, expect) const assert = chai.expect(value, message) as unknown as Assertion const _test = test || getCurrentTest() if (_test) @@ -45,6 +45,14 @@ export function createExpect(test?: Test) { // @ts-expect-error untyped expect.extend = matchers => chai.expect.extend(expect, matchers) + expect.soft = (...args) => { + const assert = expect(...args) + expect.setState({ + soft: true, + }) + return assert + } + function assertions(expected: number) { const errorGen = () => new Error(`expected number of assertions to be ${expected}, but got ${expect.getState().assertionCalls}`) if (Error.captureStackTrace) diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap new file mode 100644 index 000000000000..10c87bb1652c --- /dev/null +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -0,0 +1,233 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`expect.soft > basic 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > basic +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:26:18 + 24| + 25| test('basic', () => { + 26| expect.soft(1).toBe(2) + | ^ + 27| expect.soft(2).toBe(3) + 28| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > basic +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:27:18 + 25| test('basic', () => { + 26| expect.soft(1).toBe(2) + 27| expect.soft(2).toBe(3) + | ^ + 28| }) + 29| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ + +" +`; + +exports[`expect.soft > expect with expect.soft 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > expect with expect.soft +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:48:18 + 46| + 47| test('expect with expect.soft', () => { + 48| expect.soft(1).toEqual(2) + | ^ + 49| expect(10).toEqual(20) + 50| expect.soft(2).toEqual(3) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > expect with expect.soft +AssertionError: expected 10 to deeply equal 20 + + - Expected - 0 + + Received + 1 + + - 20 + + 10 + + ❯ soft.test.ts:49:14 + 47| test('expect with expect.soft', () => { + 48| expect.soft(1).toEqual(2) + 49| expect(10).toEqual(20) + | ^ + 50| expect.soft(2).toEqual(3) + 51| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ + +" +`; + +exports[`expect.soft > expect with expect.soft 2`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > expect with expect.soft +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:48:18 + 46| + 47| test('expect with expect.soft', () => { + 48| expect.soft(1).toEqual(2) + | ^ + 49| expect(10).toEqual(20) + 50| expect.soft(2).toEqual(3) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > expect with expect.soft +AssertionError: expected 10 to deeply equal 20 + + - Expected - 0 + + Received + 1 + + - 20 + + 10 + + ❯ soft.test.ts:49:14 + 47| test('expect with expect.soft', () => { + 48| expect.soft(1).toEqual(2) + 49| expect(10).toEqual(20) + | ^ + 50| expect.soft(2).toEqual(3) + 51| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ + +" +`; + +exports[`expect.soft > expect.soft with expect.extend 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > expect.soft with expect.extend +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:54:18 + 52| + 53| test('expect.soft with expect.extend', () => { + 54| expect.soft(1).toEqual(2) + | ^ + 55| // @ts-expect-error expect-extend + 56| expect.soft(3).toBeSquare(5) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ + + FAIL |core| soft.test.ts > expect.soft with expect.extend +Error: expected 3 to be square + ❯ soft.test.ts:56:18 + 54| expect.soft(1).toEqual(2) + 55| // @ts-expect-error expect-extend + 56| expect.soft(3).toBeSquare(5) + | ^ + 57| expect(5).toEqual(6) + 58| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ + + FAIL |core| soft.test.ts > expect.soft with expect.extend +AssertionError: expected 5 to deeply equal 6 + + - Expected - 0 + + Received + 1 + + - 6 + + 5 + + ❯ soft.test.ts:57:13 + 55| // @ts-expect-error expect-extend + 56| expect.soft(3).toBeSquare(5) + 57| expect(5).toEqual(6) + | ^ + 58| }) + 59| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ + +" +`; + +exports[`expect.soft > promise 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > promise +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:31:3 + 29| + 30| test('promise', async () => { + 31| await expect.soft( + | ^ + 32| new Promise((resolve) => { + 33| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > promise +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:38:3 + 36| }), + 37| ).resolves.toBe(2) + 38| await expect.soft( + | ^ + 39| new Promise((resolve) => { + 40| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ + +" +`; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts new file mode 100644 index 000000000000..a342cddc73f6 --- /dev/null +++ b/test/core/test/expect.test.ts @@ -0,0 +1,50 @@ +import type { UserConfig } from 'vitest' +import { describe, expect, test } from 'vitest' +import { getCurrentTest } from '@vitest/runner' +import { runVitest } from '../../test-utils' + +describe('expect.soft', () => { + const run = (config?: UserConfig) => runVitest({ root: './test/fixtures/expects', exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, ...config }, ['soft']) + test('basic', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 1 to be 2') + expect(stderr).toContain('AssertionError: expected 2 to be 3') + expect(stderr).toMatchSnapshot() + }) + + test('promise', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 2 to be 3') + expect(stderr).toContain('AssertionError: expected 1 to be 2') + expect(stderr).toMatchSnapshot() + }) + + test('expect with expect.soft', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') + expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') + expect(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') + expect(stderr).toMatchSnapshot() + }) + + test('expect with expect.soft', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') + expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') + expect(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') + expect(stderr).toMatchSnapshot() + }) + + test('expect.soft with expect.extend', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') + expect(stderr).toContain('expected 3 to be square') + expect(stderr).toContain('AssertionError: expected 5 to deeply equal 6') + expect(stderr).toMatchSnapshot() + }) + + test('expect.soft successfully', async () => { + const { stdout } = await run() + expect(stdout).toContain('1 passed') + }) +}) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts new file mode 100644 index 000000000000..7ec47bb3312d --- /dev/null +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -0,0 +1,64 @@ +import { expect, test } from 'vitest' + +expect.extend({ + toBeSquare(received, expected) { + const pass = received === expected * expected + if (pass) { + return { + pass: true, + received, + expected, + message: () => `expected ${received} not to be square`, + } + } + else { + return { + pass: false, + received, + expected, + message: () => `expected ${received} to be square`, + } + } + }, +}) + +test('basic', () => { + expect.soft(1).toBe(2) + expect.soft(2).toBe(3) +}) + +test('promise', async () => { + await expect.soft( + new Promise((resolve) => { + setTimeout(() => { + resolve(1) + }) + }), + ).resolves.toBe(2) + await expect.soft( + new Promise((resolve) => { + setTimeout(() => { + resolve(2) + }) + }), + ).resolves.toBe(3) +}) + +test('expect with expect.soft', () => { + expect.soft(1).toEqual(2) + expect(10).toEqual(20) + expect.soft(2).toEqual(3) +}) + +test('expect.soft with expect.extend', () => { + expect.soft(1).toEqual(2) + // @ts-expect-error expect-extend + expect.soft(3).toBeSquare(5) + expect(5).toEqual(6) +}) + +test('expect.soft successfully', () => { + expect.soft(1).toEqual(1) + expect(10).toEqual(10) + expect.soft(2).toEqual(2) +}) diff --git a/test/core/vitest.config.ts b/test/core/vitest.config.ts index 44f1710f9261..b869e9d40aea 100644 --- a/test/core/vitest.config.ts +++ b/test/core/vitest.config.ts @@ -1,5 +1,5 @@ import { basename, dirname, join, resolve } from 'pathe' -import { defineConfig } from 'vitest/config' +import { defaultExclude, defineConfig } from 'vitest/config' export default defineConfig({ plugins: [ @@ -41,6 +41,7 @@ export default defineConfig({ }, test: { name: 'core', + exclude: ['**/fixtures/**', ...defaultExclude], slowTestThreshold: 1000, testTimeout: 2000, setupFiles: [ From 54116a74492dc5c11f186d912284d4ccbe89eff9 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 17:39:07 +0800 Subject: [PATCH 02/39] refactor: remove softFail state --- packages/expect/src/utils.ts | 2 +- packages/runner/src/run.ts | 30 ++++++++++++++---------------- packages/runner/src/types/tasks.ts | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index fb29db2e1724..faf1c10910c7 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -36,7 +36,7 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic return fn.apply(this, args) } catch (err) { - test.result.state = 'softFail' + test.result.state = 'fail' test.result.errors ||= [] test.result.errors.push(err) } diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index b540d34ee726..0b5d49299e5c 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -156,25 +156,20 @@ export async function runTest(test: Test, runner: VitestRunner) { throw new Error('Test function is not found. Did you add it using `setFn`?') await fn() } - if (test.result.state === 'softFail') { - failTask(test.result, []) + // some async expect will be added to this array, in case user forget to await theme + if (test.promises) { + const result = await Promise.allSettled(test.promises) + const errors = result.map(r => r.status === 'rejected' ? r.reason : undefined).filter(Boolean) + if (errors.length) + throw errors } - else { - // some async expect will be added to this array, in case user forget to await theme - if (test.promises) { - const result = await Promise.allSettled(test.promises) - const errors = result.map(r => r.status === 'rejected' ? r.reason : undefined).filter(Boolean) - if (errors.length) - throw errors - } - await runner.onAfterTryTest?.(test, { retry: retryCount, repeats: repeatCount }) + await runner.onAfterTryTest?.(test, { retry: retryCount, repeats: repeatCount }) - if (!test.repeats) - test.result.state = 'pass' - else if (test.repeats && retry === retryCount) - test.result.state = 'pass' - } + if (!test.repeats) + test.result.state = 'pass' + else if (test.repeats && retry === retryCount) + test.result.state = 'pass' } catch (e) { failTask(test.result, e) @@ -190,6 +185,9 @@ export async function runTest(test: Test, runner: VitestRunner) { if (test.result.state === 'pass') break + + // reset state when retry test + test.result.state = 'run' // update retry info updateTask(test, runner) } diff --git a/packages/runner/src/types/tasks.ts b/packages/runner/src/types/tasks.ts index 139357e446a7..7ff9c4e4b7b1 100644 --- a/packages/runner/src/types/tasks.ts +++ b/packages/runner/src/types/tasks.ts @@ -3,7 +3,7 @@ import type { ChainableFunction } from '../utils/chain' import type { ErrorWithDiff } from '../utils/error' export type RunMode = 'run' | 'skip' | 'only' | 'todo' -export type TaskState = RunMode | 'pass' | 'fail' | 'softFail' +export type TaskState = RunMode | 'pass' | 'fail' export interface TaskBase { id: string From 9f2bae1b38eb03bae5c46838d25cf8e2b61c14d3 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 17:41:13 +0800 Subject: [PATCH 03/39] refactor: ensure use same softWrapper --- packages/expect/src/jest-expect.ts | 5 +++-- packages/expect/src/jest-extend.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/expect/src/jest-expect.ts b/packages/expect/src/jest-expect.ts index 07a04e88d2cf..34e1ccf4af1d 100644 --- a/packages/expect/src/jest-expect.ts +++ b/packages/expect/src/jest-expect.ts @@ -16,8 +16,9 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => { function def(name: keyof Assertion | (keyof Assertion)[], fn: ((this: Chai.AssertionStatic & Assertion, ...args: any[]) => any)) { const addMethod = (n: keyof Assertion) => { - utils.addMethod(chai.Assertion.prototype, n, wrapSoft(utils, fn)) - utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, n, wrapSoft(utils, fn)) + const softWrapper = wrapSoft(utils, fn) + utils.addMethod(chai.Assertion.prototype, n, softWrapper) + utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, n, softWrapper) } if (Array.isArray(name)) diff --git a/packages/expect/src/jest-extend.ts b/packages/expect/src/jest-extend.ts index 9b1fd9f438a4..b4d5b07b9b7a 100644 --- a/packages/expect/src/jest-extend.ts +++ b/packages/expect/src/jest-extend.ts @@ -76,8 +76,9 @@ function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiP throw new JestExtendError(message(), actual, expected) } - utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, wrapSoft(utils, expectWrapper)) - utils.addMethod(c.Assertion.prototype, expectAssertionName, wrapSoft(utils, expectWrapper)) + const softWrapper = wrapSoft(utils, expectWrapper) + utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, softWrapper) + utils.addMethod(c.Assertion.prototype, expectAssertionName, wrapSoft(utils, softWrapper)) class CustomMatcher extends AsymmetricMatcher<[unknown, ...unknown[]]> { constructor(inverse = false, ...sample: [unknown, ...unknown[]]) { From f98adb0c5918954cbeb6c5670eb0e2796e8b2211 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 18:52:58 +0800 Subject: [PATCH 04/39] fix: retry with expect.soft test is incorrect --- packages/runner/src/run.ts | 20 +- .../test/__snapshots__/expect.test.ts.snap | 240 ++++++++++++------ test/core/test/expect.test.ts | 19 +- test/core/test/fixtures/expects/soft.test.ts | 34 ++- 4 files changed, 216 insertions(+), 97 deletions(-) diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index 0b5d49299e5c..365e8890286e 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -166,10 +166,12 @@ export async function runTest(test: Test, runner: VitestRunner) { await runner.onAfterTryTest?.(test, { retry: retryCount, repeats: repeatCount }) - if (!test.repeats) - test.result.state = 'pass' - else if (test.repeats && retry === retryCount) - test.result.state = 'pass' + if (test.result.state !== 'fail') { + if (!test.repeats) + test.result.state = 'pass' + else if (test.repeats && retry === retryCount) + test.result.state = 'pass' + } } catch (e) { failTask(test.result, e) @@ -186,8 +188,14 @@ export async function runTest(test: Test, runner: VitestRunner) { if (test.result.state === 'pass') break - // reset state when retry test - test.result.state = 'run' + if (retryCount < retry - 1) { + // reset state when retry test + test.result.state = 'run' + } + else { + // last retry failed, mark test as failed + failTask(test.result, []) + } // update retry info updateTask(test, runner) } diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index 10c87bb1652c..a0f6d1eefe01 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -12,13 +12,13 @@ AssertionError: expected 1 to be 2 // Object.is equality - 2 + 1 - ❯ soft.test.ts:26:18 - 24| - 25| test('basic', () => { - 26| expect.soft(1).toBe(2) + ❯ soft.test.ts:24:18 + 22| + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) | ^ - 27| expect.soft(2).toBe(3) - 28| }) + 25| expect.soft(2).toBe(3) + 26| }) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ @@ -31,13 +31,13 @@ AssertionError: expected 2 to be 3 // Object.is equality - 3 + 2 - ❯ soft.test.ts:27:18 - 25| test('basic', () => { - 26| expect.soft(1).toBe(2) - 27| expect.soft(2).toBe(3) + ❯ soft.test.ts:25:18 + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) + 25| expect.soft(2).toBe(3) | ^ - 28| }) - 29| + 26| }) + 27| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ @@ -53,16 +53,16 @@ AssertionError: expected 1 to deeply equal 2 - Expected - 0 + Received + 1 - - 2 - + 1 + - '2' + + '1' - ❯ soft.test.ts:48:18 - 46| - 47| test('expect with expect.soft', () => { - 48| expect.soft(1).toEqual(2) + ❯ soft.test.ts:46:18 + 44| + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) | ^ - 49| expect(10).toEqual(20) - 50| expect.soft(2).toEqual(3) + 47| expect(10).toEqual(20) + 48| expect.soft(2).toEqual(3) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ @@ -72,16 +72,16 @@ AssertionError: expected 10 to deeply equal 20 - Expected - 0 + Received + 1 - - 20 - + 10 + - '20' + + '10' - ❯ soft.test.ts:49:14 - 47| test('expect with expect.soft', () => { - 48| expect.soft(1).toEqual(2) - 49| expect(10).toEqual(20) + ❯ soft.test.ts:47:14 + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) + 47| expect(10).toEqual(20) | ^ - 50| expect.soft(2).toEqual(3) - 51| }) + 48| expect.soft(2).toEqual(3) + 49| }) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ @@ -97,16 +97,16 @@ AssertionError: expected 1 to deeply equal 2 - Expected - 0 + Received + 1 - - 2 - + 1 + - '2' + + '1' - ❯ soft.test.ts:48:18 - 46| - 47| test('expect with expect.soft', () => { - 48| expect.soft(1).toEqual(2) + ❯ soft.test.ts:46:18 + 44| + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) | ^ - 49| expect(10).toEqual(20) - 50| expect.soft(2).toEqual(3) + 47| expect(10).toEqual(20) + 48| expect.soft(2).toEqual(3) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ @@ -116,22 +116,104 @@ AssertionError: expected 10 to deeply equal 20 - Expected - 0 + Received + 1 - - 20 - + 10 + - '20' + + '10' - ❯ soft.test.ts:49:14 - 47| test('expect with expect.soft', () => { - 48| expect.soft(1).toEqual(2) - 49| expect(10).toEqual(20) + ❯ soft.test.ts:47:14 + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) + 47| expect(10).toEqual(20) | ^ - 50| expect.soft(2).toEqual(3) - 51| }) + 48| expect.soft(2).toEqual(3) + 49| }) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; +exports[`expect.soft > expect.soft and retry will failed 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 1 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 1 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| num = 0 + 73| test('expect.soft and retry will failed', () => { + 74| expect.soft(num += 1).toBe(4) + | ^ + 75| expect.soft(num += 1).toBe(5) + 76| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 2 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 2 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:75:25 + 73| test('expect.soft and retry will failed', () => { + 74| expect.soft(num += 1).toBe(4) + 75| expect.soft(num += 1).toBe(5) + | ^ + 76| }, { + 77| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 3 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 3 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| num = 0 + 73| test('expect.soft and retry will failed', () => { + 74| expect.soft(num += 1).toBe(4) + | ^ + 75| expect.soft(num += 1).toBe(5) + 76| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 4 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 4 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:75:25 + 73| test('expect.soft and retry will failed', () => { + 74| expect.soft(num += 1).toBe(4) + 75| expect.soft(num += 1).toBe(5) + | ^ + 76| }, { + 77| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ + +" +`; + exports[`expect.soft > expect.soft with expect.extend 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ @@ -141,28 +223,28 @@ AssertionError: expected 1 to deeply equal 2 - Expected - 0 + Received + 1 - - 2 - + 1 + - '2' + + '1' - ❯ soft.test.ts:54:18 - 52| - 53| test('expect.soft with expect.extend', () => { - 54| expect.soft(1).toEqual(2) + ❯ soft.test.ts:52:18 + 50| + 51| test('expect.soft with expect.extend', () => { + 52| expect.soft(1).toEqual(2) | ^ - 55| // @ts-expect-error expect-extend - 56| expect.soft(3).toBeSquare(5) + 53| // @ts-expect-error expect-extend + 54| expect.soft(3).toBeDividedBy(4) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ FAIL |core| soft.test.ts > expect.soft with expect.extend -Error: expected 3 to be square - ❯ soft.test.ts:56:18 - 54| expect.soft(1).toEqual(2) - 55| // @ts-expect-error expect-extend - 56| expect.soft(3).toBeSquare(5) +Error: expected 3 to be divisible by 4 + ❯ soft.test.ts:54:18 + 52| expect.soft(1).toEqual(2) + 53| // @ts-expect-error expect-extend + 54| expect.soft(3).toBeDividedBy(4) | ^ - 57| expect(5).toEqual(6) - 58| }) + 55| expect(5).toEqual(6) + 56| }) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ @@ -172,16 +254,16 @@ AssertionError: expected 5 to deeply equal 6 - Expected - 0 + Received + 1 - - 6 - + 5 + - '6' + + '5' - ❯ soft.test.ts:57:13 - 55| // @ts-expect-error expect-extend - 56| expect.soft(3).toBeSquare(5) - 57| expect(5).toEqual(6) + ❯ soft.test.ts:55:13 + 53| // @ts-expect-error expect-extend + 54| expect.soft(3).toBeDividedBy(4) + 55| expect(5).toEqual(6) | ^ - 58| }) - 59| + 56| }) + 57| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ @@ -200,13 +282,13 @@ AssertionError: expected 1 to be 2 // Object.is equality - 2 + 1 - ❯ soft.test.ts:31:3 - 29| - 30| test('promise', async () => { - 31| await expect.soft( + ❯ soft.test.ts:29:3 + 27| + 28| test('promise', async () => { + 29| await expect.soft( | ^ - 32| new Promise((resolve) => { - 33| setTimeout(() => { + 30| new Promise((resolve) => { + 31| setTimeout(() => { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ @@ -219,13 +301,13 @@ AssertionError: expected 2 to be 3 // Object.is equality - 3 + 2 - ❯ soft.test.ts:38:3 - 36| }), - 37| ).resolves.toBe(2) - 38| await expect.soft( + ❯ soft.test.ts:36:3 + 34| }), + 35| ).resolves.toBe(2) + 36| await expect.soft( | ^ - 39| new Promise((resolve) => { - 40| setTimeout(() => { + 37| new Promise((resolve) => { + 38| setTimeout(() => { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index a342cddc73f6..0b78edbe8658 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -38,13 +38,28 @@ describe('expect.soft', () => { test('expect.soft with expect.extend', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') - expect(stderr).toContain('expected 3 to be square') + expect(stderr).toContain('Error: expected 3 to be divisible by 4') expect(stderr).toContain('AssertionError: expected 5 to deeply equal 6') expect(stderr).toMatchSnapshot() }) - test('expect.soft successfully', async () => { + test('expect.soft passed', async () => { const { stdout } = await run() expect(stdout).toContain('1 passed') }) + + test('expect.soft and retry will passed', async () => { + const { stdout, stderr } = await run() + expect(stderr).toMatchInlineSnapshot('""') + expect(stdout).toContain('1 passed') + }) + + test('expect.soft and retry will failed', async () => { + const { stderr } = await run() + expect(stderr).toContain('AssertionError: expected 1 to be 4') + expect(stderr).toContain('AssertionError: expected 2 to be 5') + expect(stderr).toContain('AssertionError: expected 3 to be 4') + expect(stderr).toContain('AssertionError: expected 4 to be 5') + expect(stderr).toMatchSnapshot() + }) }) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index 7ec47bb3312d..b5e412c6fe5b 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -1,22 +1,20 @@ import { expect, test } from 'vitest' expect.extend({ - toBeSquare(received, expected) { - const pass = received === expected * expected + toBeDividedBy(received, divisor) { + const pass = received % divisor === 0 if (pass) { return { + message: () => + `expected ${received} not to be divisible by ${divisor}`, pass: true, - received, - expected, - message: () => `expected ${received} not to be square`, } } else { return { + message: () => + `expected ${received} to be divisible by ${divisor}`, pass: false, - received, - expected, - message: () => `expected ${received} to be square`, } } }, @@ -53,12 +51,28 @@ test('expect with expect.soft', () => { test('expect.soft with expect.extend', () => { expect.soft(1).toEqual(2) // @ts-expect-error expect-extend - expect.soft(3).toBeSquare(5) + expect.soft(3).toBeDividedBy(4) expect(5).toEqual(6) }) -test('expect.soft successfully', () => { +test('expect.soft passed', () => { expect.soft(1).toEqual(1) expect(10).toEqual(10) expect.soft(2).toEqual(2) }) + +let num = 0 +test('expect.soft and retry will passed', () => { + expect.soft(num += 1).toBe(3) + expect.soft(num += 1).toBe(4) +}, { + retry: 2, +}) + +num = 0 +test('expect.soft and retry will failed', () => { + expect.soft(num += 1).toBe(4) + expect.soft(num += 1).toBe(5) +}, { + retry: 2, +}) From dd16910e933ca63b0fa36e3d2149470af855b8cd Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 19:14:18 +0800 Subject: [PATCH 05/39] fix: repeats failed --- packages/runner/src/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index 365e8890286e..2969c19af8fc 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -192,7 +192,7 @@ export async function runTest(test: Test, runner: VitestRunner) { // reset state when retry test test.result.state = 'run' } - else { + else if (test.result.state === 'fail') { // last retry failed, mark test as failed failTask(test.result, []) } From 4785e3387e0540ecbc33053e1baf76289d091e4d Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 19:26:26 +0800 Subject: [PATCH 06/39] test: fix ts error --- test/core/test/fixtures/expects/soft.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index b5e412c6fe5b..7b6fc381f782 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -49,9 +49,8 @@ test('expect with expect.soft', () => { }) test('expect.soft with expect.extend', () => { - expect.soft(1).toEqual(2) - // @ts-expect-error expect-extend - expect.soft(3).toBeDividedBy(4) + expect.soft(1).toEqual(2); + (expect.soft(3) as any).toBeDividedBy(4) expect(5).toEqual(6) }) From 6f2e0770b957d8b163872b3e8cbb55c0b280c483 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 19:30:06 +0800 Subject: [PATCH 07/39] test: update --- .../test/__snapshots__/expect.test.ts.snap | 80 +++++++++---------- test/core/test/expect.test.ts | 6 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index a0f6d1eefe01..d79524ef12de 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -144,13 +144,13 @@ AssertionError: expected 1 to be 4 // Object.is equality - 4 + 1 - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| num = 0 - 73| test('expect.soft and retry will failed', () => { - 74| expect.soft(num += 1).toBe(4) + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) | ^ - 75| expect.soft(num += 1).toBe(5) - 76| }, { + 74| expect.soft(num += 1).toBe(5) + 75| }, { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ @@ -163,13 +163,13 @@ AssertionError: expected 2 to be 5 // Object.is equality - 5 + 2 - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:75:25 - 73| test('expect.soft and retry will failed', () => { - 74| expect.soft(num += 1).toBe(4) - 75| expect.soft(num += 1).toBe(5) + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) | ^ - 76| }, { - 77| retry: 2, + 75| }, { + 76| retry: 2, ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ @@ -182,13 +182,13 @@ AssertionError: expected 3 to be 4 // Object.is equality - 4 + 3 - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| num = 0 - 73| test('expect.soft and retry will failed', () => { - 74| expect.soft(num += 1).toBe(4) + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) | ^ - 75| expect.soft(num += 1).toBe(5) - 76| }, { + 74| expect.soft(num += 1).toBe(5) + 75| }, { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ @@ -201,13 +201,13 @@ AssertionError: expected 4 to be 5 // Object.is equality - 5 + 4 - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:75:25 - 73| test('expect.soft and retry will failed', () => { - 74| expect.soft(num += 1).toBe(4) - 75| expect.soft(num += 1).toBe(5) + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) | ^ - 76| }, { - 77| retry: 2, + 75| }, { + 76| retry: 2, ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ @@ -229,22 +229,22 @@ AssertionError: expected 1 to deeply equal 2 ❯ soft.test.ts:52:18 50| 51| test('expect.soft with expect.extend', () => { - 52| expect.soft(1).toEqual(2) + 52| expect.soft(1).toEqual(2); | ^ - 53| // @ts-expect-error expect-extend - 54| expect.soft(3).toBeDividedBy(4) + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ FAIL |core| soft.test.ts > expect.soft with expect.extend Error: expected 3 to be divisible by 4 - ❯ soft.test.ts:54:18 - 52| expect.soft(1).toEqual(2) - 53| // @ts-expect-error expect-extend - 54| expect.soft(3).toBeDividedBy(4) - | ^ - 55| expect(5).toEqual(6) - 56| }) + ❯ soft.test.ts:53:27 + 51| test('expect.soft with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + | ^ + 54| expect(5).toEqual(6) + 55| }) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ @@ -257,13 +257,13 @@ AssertionError: expected 5 to deeply equal 6 - '6' + '5' - ❯ soft.test.ts:55:13 - 53| // @ts-expect-error expect-extend - 54| expect.soft(3).toBeDividedBy(4) - 55| expect(5).toEqual(6) + ❯ soft.test.ts:54:13 + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) | ^ - 56| }) - 57| + 55| }) + 56| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 0b78edbe8658..b3f0621f1f5a 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -1,10 +1,11 @@ +import { resolve } from 'node:path' import type { UserConfig } from 'vitest' import { describe, expect, test } from 'vitest' import { getCurrentTest } from '@vitest/runner' import { runVitest } from '../../test-utils' describe('expect.soft', () => { - const run = (config?: UserConfig) => runVitest({ root: './test/fixtures/expects', exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, ...config }, ['soft']) + const run = (config?: UserConfig) => runVitest({ root: resolve(__dirname, './fixtures/expects'), exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, ...config }, ['soft']) test('basic', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to be 2') @@ -49,8 +50,7 @@ describe('expect.soft', () => { }) test('expect.soft and retry will passed', async () => { - const { stdout, stderr } = await run() - expect(stderr).toMatchInlineSnapshot('""') + const { stdout } = await run() expect(stdout).toContain('1 passed') }) From 3ea9a3902080a3b95ced63ef9d510342a0c9ca5e Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 19:41:10 +0800 Subject: [PATCH 08/39] fix: should use same softWrapper --- packages/expect/src/jest-extend.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/expect/src/jest-extend.ts b/packages/expect/src/jest-extend.ts index b4d5b07b9b7a..f6160c63fb83 100644 --- a/packages/expect/src/jest-extend.ts +++ b/packages/expect/src/jest-extend.ts @@ -78,7 +78,7 @@ function JestExtendPlugin(expect: ExpectStatic, matchers: MatchersObject): ChaiP const softWrapper = wrapSoft(utils, expectWrapper) utils.addMethod((globalThis as any)[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, softWrapper) - utils.addMethod(c.Assertion.prototype, expectAssertionName, wrapSoft(utils, softWrapper)) + utils.addMethod(c.Assertion.prototype, expectAssertionName, softWrapper) class CustomMatcher extends AsymmetricMatcher<[unknown, ...unknown[]]> { constructor(inverse = false, ...sample: [unknown, ...unknown[]]) { From 244694476ac5dea92892dd59b5f7c9c53086fc86 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 20:22:43 +0800 Subject: [PATCH 09/39] fix: errors repeat handling --- packages/runner/src/run.ts | 11 +- .../test/__snapshots__/expect.test.ts.snap | 617 ++++++++++-------- test/core/test/expect.test.ts | 8 - 3 files changed, 357 insertions(+), 279 deletions(-) diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index 2969c19af8fc..91dc4d3eef0b 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -228,10 +228,19 @@ export async function runTest(test: Test, runner: VitestRunner) { updateTask(test, runner) } +const processedError = new WeakSet() function failTask(result: TaskResult, err: unknown) { result.state = 'fail' const errors = Array.isArray(err) ? err : [err] - result.errors = [...result.errors || [], ...errors].map(err => processError(err)) + // errors maybe push in expect.soft, so we need to process them + result.errors = [...result.errors || [], ...errors].map((err) => { + let newError = err + if (!processedError.has(err)) { + newError = processError(err) + processedError.add(newError) + } + return newError + }) const errorsLength = result.errors.length if (errorsLength > 0) result.error = result.errors[errorsLength - 1] diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index d79524ef12de..b1cbba29c1b1 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -4,42 +4,56 @@ exports[`expect.soft > basic 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > basic -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:24:18 - 22| - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - | ^ - 25| expect.soft(2).toBe(3) - 26| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > basic -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:25:18 - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - 25| expect.soft(2).toBe(3) - | ^ - 26| }) - 27| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ +Unknown Error: undefined +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ +Serialized Error: { + \\"0\\": { + \\"actual\\": 1, + \\"constructor\\": \\"Function\\", + \\"expected\\": 2, + \\"message\\": \\"expected 1 to be 2 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 1 to be 2 // Object.is equality + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:24:18 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"1\\": { + \\"actual\\": 2, + \\"constructor\\": \\"Function\\", + \\"expected\\": 3, + \\"message\\": \\"expected 2 to be 3 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 2 to be 3 // Object.is equality + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:25:18 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"length\\": 2, +} +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ " `; @@ -48,86 +62,75 @@ exports[`expect.soft > expect with expect.soft 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - '2' - + '1' - - ❯ soft.test.ts:46:18 - 44| - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - | ^ - 47| expect(10).toEqual(20) - 48| expect.soft(2).toEqual(3) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 10 to deeply equal 20 - - - Expected - 0 - + Received + 1 - - - '20' - + '10' - - ❯ soft.test.ts:47:14 - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - 47| expect(10).toEqual(20) - | ^ - 48| expect.soft(2).toEqual(3) - 49| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ - -" -`; - -exports[`expect.soft > expect with expect.soft 2`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 +Unknown Error: undefined +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ +Serialized Error: { + \\"0\\": [ + { + \\"actual\\": 1, + \\"constructor\\": \\"Function\\", + \\"expected\\": 2, + \\"message\\": \\"expected 1 to deeply equal 2\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 1 to deeply equal 2 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:46:18 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + ], + \\"1\\": { + \\"actual\\": \\"10\\", + \\"constructor\\": \\"Function\\", + \\"diff\\": \\" - Expected - 0 + Received + 1 - - '2' - + '1' - - ❯ soft.test.ts:46:18 - 44| - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - | ^ - 47| expect(10).toEqual(20) - 48| expect.soft(2).toEqual(3) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 10 to deeply equal 20 - - - Expected - 0 - + Received + 1 - - - '20' - + '10' - - ❯ soft.test.ts:47:14 - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - 47| expect(10).toEqual(20) - | ^ - 48| expect.soft(2).toEqual(3) - 49| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ + - 20 + + 10\\", + \\"expected\\": \\"20\\", + \\"message\\": \\"expected 10 to deeply equal 20\\", + \\"name\\": \\"AssertionError\\", + \\"nameStr\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 10 to deeply equal 20 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:47:14 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"stackStr\\": \\"AssertionError: expected 10 to deeply equal 20 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:47:14 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"length\\": 2, +} +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ " `; @@ -136,80 +139,100 @@ exports[`expect.soft > expect.soft and retry will failed 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect.soft and retry will failed -AssertionError: expected 1 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 1 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('expect.soft and retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ - - FAIL |core| soft.test.ts > expect.soft and retry will failed -AssertionError: expected 2 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 2 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('expect.soft and retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ - - FAIL |core| soft.test.ts > expect.soft and retry will failed -AssertionError: expected 3 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 3 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('expect.soft and retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ - - FAIL |core| soft.test.ts > expect.soft and retry will failed -AssertionError: expected 4 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 4 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('expect.soft and retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ +Unknown Error: undefined +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ +Serialized Error: { + \\"0\\": { + \\"actual\\": 1, + \\"constructor\\": \\"Function\\", + \\"expected\\": 4, + \\"message\\": \\"expected 1 to be 4 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 1 to be 4 // Object.is equality + at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:73:25) + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"1\\": { + \\"actual\\": 2, + \\"constructor\\": \\"Function\\", + \\"expected\\": 5, + \\"message\\": \\"expected 2 to be 5 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 2 to be 5 // Object.is equality + at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:74:25) + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"2\\": { + \\"actual\\": 3, + \\"constructor\\": \\"Function\\", + \\"expected\\": 4, + \\"message\\": \\"expected 3 to be 4 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 3 to be 4 // Object.is equality + at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:73:25) + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"3\\": { + \\"actual\\": 4, + \\"constructor\\": \\"Function\\", + \\"expected\\": 5, + \\"message\\": \\"expected 4 to be 5 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 4 to be 5 // Object.is equality + at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:74:25) + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"length\\": 4, +} +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ " `; @@ -218,54 +241,94 @@ exports[`expect.soft > expect.soft with expect.extend 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect.soft with expect.extend -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - '2' - + '1' - - ❯ soft.test.ts:52:18 - 50| - 51| test('expect.soft with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - | ^ - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ - - FAIL |core| soft.test.ts > expect.soft with expect.extend -Error: expected 3 to be divisible by 4 - ❯ soft.test.ts:53:27 - 51| test('expect.soft with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - | ^ - 54| expect(5).toEqual(6) - 55| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ - - FAIL |core| soft.test.ts > expect.soft with expect.extend -AssertionError: expected 5 to deeply equal 6 - - - Expected - 0 +Unknown Error: undefined +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ +Serialized Error: { + \\"0\\": [ + { + \\"actual\\": 1, + \\"constructor\\": \\"Function\\", + \\"expected\\": 2, + \\"message\\": \\"expected 1 to deeply equal 2\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 1 to deeply equal 2 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:52:18 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + { + \\"actual\\": undefined, + \\"constructor\\": \\"Function\\", + \\"expected\\": undefined, + \\"message\\": \\"expected 3 to be divisible by 4\\", + \\"name\\": \\"Error\\", + \\"stack\\": \\"Error: expected 3 to be divisible by 4 + at Proxy.expectWrapper (file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1340:17) + at Proxy. (file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:648:17) + at Proxy.methodWrapper (/Users/qing/p/github/vitest/node_modules/.pnpm/chai@4.3.7/node_modules/chai/lib/chai/utils/addMethod.js:57:25) + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:53:27 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3)\\", + \\"toString\\": \\"Function\\", + }, + ], + \\"1\\": { + \\"actual\\": \\"5\\", + \\"constructor\\": \\"Function\\", + \\"diff\\": \\" - Expected - 0 + Received + 1 - - '6' - + '5' - - ❯ soft.test.ts:54:13 - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - | ^ - 55| }) - 56| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ + - 6 + + 5\\", + \\"expected\\": \\"6\\", + \\"message\\": \\"expected 5 to deeply equal 6\\", + \\"name\\": \\"AssertionError\\", + \\"nameStr\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 5 to deeply equal 6 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:54:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"stackStr\\": \\"AssertionError: expected 5 to deeply equal 6 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:54:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 + at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"length\\": 2, +} +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ " `; @@ -274,42 +337,56 @@ exports[`expect.soft > promise 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > promise -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:29:3 - 27| - 28| test('promise', async () => { - 29| await expect.soft( - | ^ - 30| new Promise((resolve) => { - 31| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > promise -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:36:3 - 34| }), - 35| ).resolves.toBe(2) - 36| await expect.soft( - | ^ - 37| new Promise((resolve) => { - 38| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ +Unknown Error: undefined +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ +Serialized Error: { + \\"0\\": { + \\"actual\\": 1, + \\"constructor\\": \\"Function\\", + \\"expected\\": 2, + \\"message\\": \\"expected 1 to be 2 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 1 to be 2 // Object.is equality + at file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1250:29 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:29:3 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:11) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/worker.ts:66:5)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"1\\": { + \\"actual\\": 2, + \\"constructor\\": \\"Function\\", + \\"expected\\": 3, + \\"message\\": \\"expected 2 to be 3 // Object.is equality\\", + \\"name\\": \\"AssertionError\\", + \\"operator\\": \\"strictEqual\\", + \\"showDiff\\": true, + \\"stack\\": \\"AssertionError: expected 2 to be 3 // Object.is equality + at file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1250:29 + at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:36:3 + at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:11) + at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) + at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) + at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) + at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 + at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9) + at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/worker.ts:66:5)\\", + \\"toJSON\\": \\"Function\\", + \\"toString\\": \\"Function\\", + }, + \\"length\\": 2, +} +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ " `; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index b3f0621f1f5a..edb7e435ecbb 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -28,14 +28,6 @@ describe('expect.soft', () => { expect(stderr).toMatchSnapshot() }) - test('expect with expect.soft', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') - expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') - expect(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') - expect(stderr).toMatchSnapshot() - }) - test('expect.soft with expect.extend', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') From 2d4e6e5d7111ae10a12e9cdd8f9dbf6fa62b5303 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 20:28:34 +0800 Subject: [PATCH 10/39] test: update snapshot --- .../test/__snapshots__/expect.test.ts.snap | 569 +++++++----------- 1 file changed, 224 insertions(+), 345 deletions(-) diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index b1cbba29c1b1..ba90f0eefbd1 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -4,56 +4,42 @@ exports[`expect.soft > basic 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > basic -Unknown Error: undefined -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ -Serialized Error: { - \\"0\\": { - \\"actual\\": 1, - \\"constructor\\": \\"Function\\", - \\"expected\\": 2, - \\"message\\": \\"expected 1 to be 2 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 1 to be 2 // Object.is equality - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:24:18 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"1\\": { - \\"actual\\": 2, - \\"constructor\\": \\"Function\\", - \\"expected\\": 3, - \\"message\\": \\"expected 2 to be 3 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 2 to be 3 // Object.is equality - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:25:18 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"length\\": 2, -} -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:24:18 + 22| + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) + | ^ + 25| expect.soft(2).toBe(3) + 26| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > basic +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:25:18 + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) + 25| expect.soft(2).toBe(3) + | ^ + 26| }) + 27| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; @@ -62,75 +48,42 @@ exports[`expect.soft > expect with expect.soft 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect with expect.soft -Unknown Error: undefined -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ -Serialized Error: { - \\"0\\": [ - { - \\"actual\\": 1, - \\"constructor\\": \\"Function\\", - \\"expected\\": 2, - \\"message\\": \\"expected 1 to deeply equal 2\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 1 to deeply equal 2 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:46:18 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - ], - \\"1\\": { - \\"actual\\": \\"10\\", - \\"constructor\\": \\"Function\\", - \\"diff\\": \\" - Expected - 0 +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:46:18 + 44| + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) + | ^ + 47| expect(10).toEqual(20) + 48| expect.soft(2).toEqual(3) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > expect with expect.soft +AssertionError: expected 10 to deeply equal 20 + + - Expected - 0 + Received + 1 - 20 - + 10\\", - \\"expected\\": \\"20\\", - \\"message\\": \\"expected 10 to deeply equal 20\\", - \\"name\\": \\"AssertionError\\", - \\"nameStr\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 10 to deeply equal 20 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:47:14 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"stackStr\\": \\"AssertionError: expected 10 to deeply equal 20 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:47:14 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"length\\": 2, -} -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ + + 10 + + ❯ soft.test.ts:47:14 + 45| test('expect with expect.soft', () => { + 46| expect.soft(1).toEqual(2) + 47| expect(10).toEqual(20) + | ^ + 48| expect.soft(2).toEqual(3) + 49| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; @@ -139,100 +92,80 @@ exports[`expect.soft > expect.soft and retry will failed 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect.soft and retry will failed -Unknown Error: undefined -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ -Serialized Error: { - \\"0\\": { - \\"actual\\": 1, - \\"constructor\\": \\"Function\\", - \\"expected\\": 4, - \\"message\\": \\"expected 1 to be 4 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 1 to be 4 // Object.is equality - at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:73:25) - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"1\\": { - \\"actual\\": 2, - \\"constructor\\": \\"Function\\", - \\"expected\\": 5, - \\"message\\": \\"expected 2 to be 5 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 2 to be 5 // Object.is equality - at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:74:25) - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"2\\": { - \\"actual\\": 3, - \\"constructor\\": \\"Function\\", - \\"expected\\": 4, - \\"message\\": \\"expected 3 to be 4 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 3 to be 4 // Object.is equality - at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:73:25) - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"3\\": { - \\"actual\\": 4, - \\"constructor\\": \\"Function\\", - \\"expected\\": 5, - \\"message\\": \\"expected 4 to be 5 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 4 to be 5 // Object.is equality - at __vite_ssr_import_0__.test.retry (/Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:74:25) - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"length\\": 4, -} -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ +AssertionError: expected 1 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 1 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + | ^ + 74| expect.soft(num += 1).toBe(5) + 75| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 2 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 2 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) + | ^ + 75| }, { + 76| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 3 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 3 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + | ^ + 74| expect.soft(num += 1).toBe(5) + 75| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ + + FAIL |core| soft.test.ts > expect.soft and retry will failed +AssertionError: expected 4 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 4 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('expect.soft and retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) + | ^ + 75| }, { + 76| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ " `; @@ -241,94 +174,54 @@ exports[`expect.soft > expect.soft with expect.extend 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > expect.soft with expect.extend -Unknown Error: undefined -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ -Serialized Error: { - \\"0\\": [ - { - \\"actual\\": 1, - \\"constructor\\": \\"Function\\", - \\"expected\\": 2, - \\"message\\": \\"expected 1 to deeply equal 2\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 1 to deeply equal 2 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:52:18 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - { - \\"actual\\": undefined, - \\"constructor\\": \\"Function\\", - \\"expected\\": undefined, - \\"message\\": \\"expected 3 to be divisible by 4\\", - \\"name\\": \\"Error\\", - \\"stack\\": \\"Error: expected 3 to be divisible by 4 - at Proxy.expectWrapper (file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1340:17) - at Proxy. (file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:648:17) - at Proxy.methodWrapper (/Users/qing/p/github/vitest/node_modules/.pnpm/chai@4.3.7/node_modules/chai/lib/chai/utils/addMethod.js:57:25) - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:53:27 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3)\\", - \\"toString\\": \\"Function\\", - }, - ], - \\"1\\": { - \\"actual\\": \\"5\\", - \\"constructor\\": \\"Function\\", - \\"diff\\": \\" - Expected - 0 +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:52:18 + 50| + 51| test('expect.soft with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + | ^ + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ + + FAIL |core| soft.test.ts > expect.soft with expect.extend +Error: expected 3 to be divisible by 4 + ❯ soft.test.ts:53:27 + 51| test('expect.soft with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + | ^ + 54| expect(5).toEqual(6) + 55| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ + + FAIL |core| soft.test.ts > expect.soft with expect.extend +AssertionError: expected 5 to deeply equal 6 + + - Expected - 0 + Received + 1 - 6 - + 5\\", - \\"expected\\": \\"6\\", - \\"message\\": \\"expected 5 to deeply equal 6\\", - \\"name\\": \\"AssertionError\\", - \\"nameStr\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 5 to deeply equal 6 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:54:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"stackStr\\": \\"AssertionError: expected 5 to deeply equal 6 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:54:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:144:13 - at file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:41:26 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:17) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"length\\": 2, -} -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ + + 5 + + ❯ soft.test.ts:54:13 + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) + | ^ + 55| }) + 56| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ " `; @@ -337,56 +230,42 @@ exports[`expect.soft > promise 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL |core| soft.test.ts > promise -Unknown Error: undefined -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ -Serialized Error: { - \\"0\\": { - \\"actual\\": 1, - \\"constructor\\": \\"Function\\", - \\"expected\\": 2, - \\"message\\": \\"expected 1 to be 2 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 1 to be 2 // Object.is equality - at file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1250:29 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:29:3 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:11) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/worker.ts:66:5)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"1\\": { - \\"actual\\": 2, - \\"constructor\\": \\"Function\\", - \\"expected\\": 3, - \\"message\\": \\"expected 2 to be 3 // Object.is equality\\", - \\"name\\": \\"AssertionError\\", - \\"operator\\": \\"strictEqual\\", - \\"showDiff\\": true, - \\"stack\\": \\"AssertionError: expected 2 to be 3 // Object.is equality - at file:///Users/qing/p/github/vitest/packages/expect/dist/index.js:1250:29 - at /Users/qing/p/github/vitest/test/core/test/fixtures/expects/soft.test.ts:36:3 - at runTest (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:487:11) - at runSuite (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:603:15) - at runFiles (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:654:5) - at startTests (file:///Users/qing/p/github/vitest/packages/runner/dist/index.js:663:3) - at file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:125:7 - at withEnv (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/setup.node.ts:185:5) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/entry.ts:111:9) - at run (file:///Users/qing/p/github/vitest/packages/vitest/src/runtime/worker.ts:66:5)\\", - \\"toJSON\\": \\"Function\\", - \\"toString\\": \\"Function\\", - }, - \\"length\\": 2, -} -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:29:3 + 27| + 28| test('promise', async () => { + 29| await expect.soft( + | ^ + 30| new Promise((resolve) => { + 31| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ + + FAIL |core| soft.test.ts > promise +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:36:3 + 34| }), + 35| ).resolves.toBe(2) + 36| await expect.soft( + | ^ + 37| new Promise((resolve) => { + 38| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; From 18cec9df0b39e33dc2cda8b453c33f31cdf96274 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 20:45:19 +0800 Subject: [PATCH 11/39] test: update snapshot --- .../test/__snapshots__/expect.test.ts.snap | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index ba90f0eefbd1..d42561dfc393 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -6,7 +6,7 @@ exports[`expect.soft > basic 1`] = ` FAIL |core| soft.test.ts > basic AssertionError: expected 1 to be 2 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 2 @@ -25,7 +25,7 @@ AssertionError: expected 1 to be 2 // Object.is equality FAIL |core| soft.test.ts > basic AssertionError: expected 2 to be 3 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 3 @@ -37,7 +37,7 @@ AssertionError: expected 2 to be 3 // Object.is equality 25| expect.soft(2).toBe(3) | ^ 26| }) - 27| + 27| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ @@ -50,14 +50,14 @@ exports[`expect.soft > expect with expect.soft 1`] = ` FAIL |core| soft.test.ts > expect with expect.soft AssertionError: expected 1 to deeply equal 2 - - Expected - 0 + - Expected - 1 + Received + 1 - 2 + 1 ❯ soft.test.ts:46:18 - 44| + 44| 45| test('expect with expect.soft', () => { 46| expect.soft(1).toEqual(2) | ^ @@ -69,7 +69,7 @@ AssertionError: expected 1 to deeply equal 2 FAIL |core| soft.test.ts > expect with expect.soft AssertionError: expected 10 to deeply equal 20 - - Expected - 0 + - Expected - 1 + Received + 1 - 20 @@ -94,7 +94,7 @@ exports[`expect.soft > expect.soft and retry will failed 1`] = ` FAIL |core| soft.test.ts > expect.soft and retry will failed AssertionError: expected 1 to be 4 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 4 @@ -113,7 +113,7 @@ AssertionError: expected 1 to be 4 // Object.is equality FAIL |core| soft.test.ts > expect.soft and retry will failed AssertionError: expected 2 to be 5 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 5 @@ -132,7 +132,7 @@ AssertionError: expected 2 to be 5 // Object.is equality FAIL |core| soft.test.ts > expect.soft and retry will failed AssertionError: expected 3 to be 4 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 4 @@ -151,7 +151,7 @@ AssertionError: expected 3 to be 4 // Object.is equality FAIL |core| soft.test.ts > expect.soft and retry will failed AssertionError: expected 4 to be 5 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 5 @@ -176,14 +176,14 @@ exports[`expect.soft > expect.soft with expect.extend 1`] = ` FAIL |core| soft.test.ts > expect.soft with expect.extend AssertionError: expected 1 to deeply equal 2 - - Expected - 0 + - Expected - 1 + Received + 1 - 2 + 1 ❯ soft.test.ts:52:18 - 50| + 50| 51| test('expect.soft with expect.extend', () => { 52| expect.soft(1).toEqual(2); | ^ @@ -207,7 +207,7 @@ Error: expected 3 to be divisible by 4 FAIL |core| soft.test.ts > expect.soft with expect.extend AssertionError: expected 5 to deeply equal 6 - - Expected - 0 + - Expected - 1 + Received + 1 - 6 @@ -219,7 +219,7 @@ AssertionError: expected 5 to deeply equal 6 54| expect(5).toEqual(6) | ^ 55| }) - 56| + 56| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ @@ -232,14 +232,14 @@ exports[`expect.soft > promise 1`] = ` FAIL |core| soft.test.ts > promise AssertionError: expected 1 to be 2 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 2 + 1 ❯ soft.test.ts:29:3 - 27| + 27| 28| test('promise', async () => { 29| await expect.soft( | ^ @@ -251,7 +251,7 @@ AssertionError: expected 1 to be 2 // Object.is equality FAIL |core| soft.test.ts > promise AssertionError: expected 2 to be 3 // Object.is equality - - Expected - 0 + - Expected - 1 + Received + 1 - 3 From 24052316e7ba4906a05530d04441d4b25ff81cc2 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 13:35:49 +0000 Subject: [PATCH 12/39] test: update test name and snapshot --- .../test/__snapshots__/expect.test.ts.snap | 206 +++++++++++------- test/core/test/expect.test.ts | 10 +- test/core/test/fixtures/expects/soft.test.ts | 10 +- 3 files changed, 138 insertions(+), 88 deletions(-) diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap index d42561dfc393..244facca8a52 100644 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -6,7 +6,7 @@ exports[`expect.soft > basic 1`] = ` FAIL |core| soft.test.ts > basic AssertionError: expected 1 to be 2 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 2 @@ -25,7 +25,7 @@ AssertionError: expected 1 to be 2 // Object.is equality FAIL |core| soft.test.ts > basic AssertionError: expected 2 to be 3 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 3 @@ -37,64 +37,64 @@ AssertionError: expected 2 to be 3 // Object.is equality 25| expect.soft(2).toBe(3) | ^ 26| }) - 27| + 27| ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; -exports[`expect.soft > expect with expect.soft 1`] = ` +exports[`expect.soft > promise 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 1 to deeply equal 2 + FAIL |core| soft.test.ts > promise +AssertionError: expected 1 to be 2 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 2 + 1 - ❯ soft.test.ts:46:18 - 44| - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - | ^ - 47| expect(10).toEqual(20) - 48| expect.soft(2).toEqual(3) + ❯ soft.test.ts:29:3 + 27| + 28| test('promise', async () => { + 29| await expect.soft( + | ^ + 30| new Promise((resolve) => { + 31| setTimeout(() => { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - FAIL |core| soft.test.ts > expect with expect.soft -AssertionError: expected 10 to deeply equal 20 + FAIL |core| soft.test.ts > promise +AssertionError: expected 2 to be 3 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - - 20 - + 10 + - 3 + + 2 - ❯ soft.test.ts:47:14 - 45| test('expect with expect.soft', () => { - 46| expect.soft(1).toEqual(2) - 47| expect(10).toEqual(20) - | ^ - 48| expect.soft(2).toEqual(3) - 49| }) + ❯ soft.test.ts:36:3 + 34| }), + 35| ).resolves.toBe(2) + 36| await expect.soft( + | ^ + 37| new Promise((resolve) => { + 38| setTimeout(() => { ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ " `; -exports[`expect.soft > expect.soft and retry will failed 1`] = ` +exports[`expect.soft > retry will failed 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - FAIL |core| soft.test.ts > expect.soft and retry will failed + FAIL |core| soft.test.ts > retry will failed AssertionError: expected 1 to be 4 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 4 @@ -102,7 +102,7 @@ AssertionError: expected 1 to be 4 // Object.is equality ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 71| num = 0 - 72| test('expect.soft and retry will failed', () => { + 72| test('retry will failed', () => { 73| expect.soft(num += 1).toBe(4) | ^ 74| expect.soft(num += 1).toBe(5) @@ -110,17 +110,17 @@ AssertionError: expected 1 to be 4 // Object.is equality ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ - FAIL |core| soft.test.ts > expect.soft and retry will failed + FAIL |core| soft.test.ts > retry will failed AssertionError: expected 2 to be 5 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 5 + 2 ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('expect.soft and retry will failed', () => { + 72| test('retry will failed', () => { 73| expect.soft(num += 1).toBe(4) 74| expect.soft(num += 1).toBe(5) | ^ @@ -129,10 +129,10 @@ AssertionError: expected 2 to be 5 // Object.is equality ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ - FAIL |core| soft.test.ts > expect.soft and retry will failed + FAIL |core| soft.test.ts > retry will failed AssertionError: expected 3 to be 4 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 4 @@ -140,7 +140,7 @@ AssertionError: expected 3 to be 4 // Object.is equality ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 71| num = 0 - 72| test('expect.soft and retry will failed', () => { + 72| test('retry will failed', () => { 73| expect.soft(num += 1).toBe(4) | ^ 74| expect.soft(num += 1).toBe(5) @@ -148,17 +148,17 @@ AssertionError: expected 3 to be 4 // Object.is equality ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ - FAIL |core| soft.test.ts > expect.soft and retry will failed + FAIL |core| soft.test.ts > retry will failed AssertionError: expected 4 to be 5 // Object.is equality - - Expected - 1 + - Expected - 0 + Received + 1 - 5 + 4 ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('expect.soft and retry will failed', () => { + 72| test('retry will failed', () => { 73| expect.soft(num += 1).toBe(4) 74| expect.soft(num += 1).toBe(5) | ^ @@ -170,44 +170,82 @@ AssertionError: expected 4 to be 5 // Object.is equality " `; -exports[`expect.soft > expect.soft with expect.extend 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ +exports[`expect.soft > with expect 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯ - FAIL |core| soft.test.ts > expect.soft with expect.extend + FAIL |core| soft.test.ts > with expect AssertionError: expected 1 to deeply equal 2 - - Expected - 1 + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:46:18 + 44| + 45| test('with expect', () => { + 46| expect.soft(1).toEqual(2) + | ^ + 47| expect(10).toEqual(20) + 48| expect.soft(2).toEqual(3) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯ + + FAIL |core| soft.test.ts > with expect +AssertionError: expected 10 to deeply equal 20 + + - Expected - 0 + + Received + 1 + + - 20 + + 10 + + ❯ soft.test.ts:47:14 + 45| test('with expect', () => { + 46| expect.soft(1).toEqual(2) + 47| expect(10).toEqual(20) + | ^ + 48| expect.soft(2).toEqual(3) + 49| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯ + + FAIL |core| soft.test.ts > with expect.extend +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + Received + 1 - 2 + 1 ❯ soft.test.ts:52:18 - 50| - 51| test('expect.soft with expect.extend', () => { + 50| + 51| test('with expect.extend', () => { 52| expect.soft(1).toEqual(2); | ^ 53| (expect.soft(3) as any).toBeDividedBy(4) 54| expect(5).toEqual(6) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯ - FAIL |core| soft.test.ts > expect.soft with expect.extend + FAIL |core| soft.test.ts > with expect.extend Error: expected 3 to be divisible by 4 ❯ soft.test.ts:53:27 - 51| test('expect.soft with expect.extend', () => { + 51| test('with expect.extend', () => { 52| expect.soft(1).toEqual(2); 53| (expect.soft(3) as any).toBeDividedBy(4) | ^ 54| expect(5).toEqual(6) 55| }) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/5]⎯ - FAIL |core| soft.test.ts > expect.soft with expect.extend + FAIL |core| soft.test.ts > with expect.extend AssertionError: expected 5 to deeply equal 6 - - Expected - 1 + - Expected - 0 + Received + 1 - 6 @@ -219,53 +257,65 @@ AssertionError: expected 5 to deeply equal 6 54| expect(5).toEqual(6) | ^ 55| }) - 56| + 56| -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/5]⎯ " `; -exports[`expect.soft > promise 1`] = ` +exports[`expect.soft > with expect.extend 1`] = ` "⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - FAIL |core| soft.test.ts > promise -AssertionError: expected 1 to be 2 // Object.is equality + FAIL |core| soft.test.ts > with expect.extend +AssertionError: expected 1 to deeply equal 2 - - Expected - 1 + - Expected - 0 + Received + 1 - 2 + 1 - ❯ soft.test.ts:29:3 - 27| - 28| test('promise', async () => { - 29| await expect.soft( - | ^ - 30| new Promise((resolve) => { - 31| setTimeout(() => { + ❯ soft.test.ts:52:18 + 50| + 51| test('with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + | ^ + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ - FAIL |core| soft.test.ts > promise -AssertionError: expected 2 to be 3 // Object.is equality + FAIL |core| soft.test.ts > with expect.extend +Error: expected 3 to be divisible by 4 + ❯ soft.test.ts:53:27 + 51| test('with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + | ^ + 54| expect(5).toEqual(6) + 55| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ - - Expected - 1 + FAIL |core| soft.test.ts > with expect.extend +AssertionError: expected 5 to deeply equal 6 + + - Expected - 0 + Received + 1 - - 3 - + 2 + - 6 + + 5 - ❯ soft.test.ts:36:3 - 34| }), - 35| ).resolves.toBe(2) - 36| await expect.soft( - | ^ - 37| new Promise((resolve) => { - 38| setTimeout(() => { + ❯ soft.test.ts:54:13 + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) + | ^ + 55| }) + 56| -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ " `; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index edb7e435ecbb..1a49e8c6be8f 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -20,7 +20,7 @@ describe('expect.soft', () => { expect(stderr).toMatchSnapshot() }) - test('expect with expect.soft', async () => { + test('with expect', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') @@ -28,7 +28,7 @@ describe('expect.soft', () => { expect(stderr).toMatchSnapshot() }) - test('expect.soft with expect.extend', async () => { + test('with expect.extend', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') expect(stderr).toContain('Error: expected 3 to be divisible by 4') @@ -36,17 +36,17 @@ describe('expect.soft', () => { expect(stderr).toMatchSnapshot() }) - test('expect.soft passed', async () => { + test('passed', async () => { const { stdout } = await run() expect(stdout).toContain('1 passed') }) - test('expect.soft and retry will passed', async () => { + test('retry will passed', async () => { const { stdout } = await run() expect(stdout).toContain('1 passed') }) - test('expect.soft and retry will failed', async () => { + test('retry will failed', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to be 4') expect(stderr).toContain('AssertionError: expected 2 to be 5') diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index 7b6fc381f782..2ae52263cb73 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -42,26 +42,26 @@ test('promise', async () => { ).resolves.toBe(3) }) -test('expect with expect.soft', () => { +test('with expect', () => { expect.soft(1).toEqual(2) expect(10).toEqual(20) expect.soft(2).toEqual(3) }) -test('expect.soft with expect.extend', () => { +test('with expect.extend', () => { expect.soft(1).toEqual(2); (expect.soft(3) as any).toBeDividedBy(4) expect(5).toEqual(6) }) -test('expect.soft passed', () => { +test('passed', () => { expect.soft(1).toEqual(1) expect(10).toEqual(10) expect.soft(2).toEqual(2) }) let num = 0 -test('expect.soft and retry will passed', () => { +test('retry will passed', () => { expect.soft(num += 1).toBe(3) expect.soft(num += 1).toBe(4) }, { @@ -69,7 +69,7 @@ test('expect.soft and retry will passed', () => { }) num = 0 -test('expect.soft and retry will failed', () => { +test('retry will failed', () => { expect.soft(num += 1).toBe(4) expect.soft(num += 1).toBe(5) }, { From 49c892dcd5a05c328dafaa0b134de25305c2324e Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 13:50:12 +0000 Subject: [PATCH 13/39] test: remove snap --- pnpm-lock.yaml | 326 ++++++++++-------- .../test/__snapshots__/expect.test.ts.snap | 321 ----------------- test/core/test/expect.test.ts | 10 +- 3 files changed, 177 insertions(+), 480 deletions(-) delete mode 100644 test/core/test/__snapshots__/expect.test.ts.snap diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a65e911d3eaa..a75fc37c695c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,7 +325,7 @@ importers: version: 20.2.5 '@types/react': specifier: latest - version: 18.2.7 + version: 18.2.8 '@vitejs/plugin-react': specifier: latest version: 4.0.0(vite@4.3.9) @@ -392,7 +392,7 @@ importers: version: link:../../packages/ui happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 jsdom: specifier: latest version: 22.1.0 @@ -731,10 +731,10 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.0 - version: 2.0.0(svelte@3.58.0)(vite@4.3.9) + version: 2.0.0(svelte@3.59.1)(vite@4.3.9) '@testing-library/svelte': specifier: ^3.2.2 - version: 3.2.2(svelte@3.58.0) + version: 3.2.2(svelte@3.59.1) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -743,7 +743,7 @@ importers: version: 22.1.0 svelte: specifier: latest - version: 3.58.0 + version: 3.59.1 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -768,10 +768,10 @@ importers: version: 22.1.0 unplugin-auto-import: specifier: latest - version: 0.12.1(rollup@3.20.2) + version: 0.16.4(rollup@3.20.2) unplugin-vue-components: specifier: latest - version: 0.22.12(rollup@3.20.2)(vue@3.3.4) + version: 0.25.0(rollup@3.20.2)(vue@3.3.4) vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -1416,7 +1416,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/base: devDependencies: @@ -1530,7 +1530,7 @@ importers: version: 2.3.2(vue@3.3.4) happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 istanbul-lib-coverage: specifier: ^3.2.0 version: 3.2.0 @@ -1545,7 +1545,7 @@ importers: version: 3.3.4 webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/css: devDependencies: @@ -1810,7 +1810,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/web-worker: devDependencies: @@ -2083,6 +2083,10 @@ packages: resolution: {integrity: sha512-vy9fM3pIxZmX07dL+VX1aZe7ynZ+YyB0jY+jE6r3hOK6GNY2t6W8rzpFC4tgpbXUYABkFQwgJq2XYXlxbXAI0g==} dev: true + /@antfu/utils@0.7.4: + resolution: {integrity: sha512-qe8Nmh9rYI/HIspLSTwtbMFPj6dISG6+dJnOguTlPNXtCvS2uezdxscVBb7/3DrmNbQK49TDqpkSQ1chbRGdpQ==} + dev: true + /@apideck/better-ajv-errors@0.3.6(ajv@8.11.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2159,7 +2163,7 @@ packages: gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 source-map: 0.5.7 transitivePeerDependencies: @@ -2409,7 +2413,7 @@ packages: '@babel/traverse': 7.21.4 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2425,7 +2429,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2441,7 +2445,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -5477,7 +5481,7 @@ packages: resolution: {integrity: sha512-6MvDI+I6QMvXn5rK9KQGdpEE4mmLTcuQdLZEiX5N+uZB+vc4Yw9K1OtnOgkl8mp4d9X0UrILREyZgF1NUwUt+Q==} dependencies: '@antfu/install-pkg': 0.1.1 - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@iconify/types': 2.0.0 debug: 4.3.4(supports-color@8.1.1) kolorist: 1.7.0 @@ -6340,8 +6344,8 @@ packages: - supports-color dev: true - /@puppeteer/browsers@1.0.1(typescript@5.0.4): - resolution: {integrity: sha512-9wkYhON9zBgtjYRE3FcokGCfjG25zjzNAYmsHpiWitRZ/4DeT3v125/fCUU66SaPJ4nUsxGNPgpS1TOcQ+8StA==} + /@puppeteer/browsers@1.3.0(typescript@5.0.4): + resolution: {integrity: sha512-an3QdbNPkuU6qpxpbssxAbjRLJcF+eP4L8UqIY3+6n0sbaVxw5pz7PiCLy9g32XEZuoamUlV5ZQPnA6FxvkIHA==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -6448,7 +6452,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 2.79.1 dev: true @@ -7957,7 +7961,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.58.0)(vite@4.3.9): + /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.59.1)(vite@4.3.9): resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -7968,8 +7972,8 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.27.0 - svelte: 3.58.0 - svelte-hmr: 0.15.1(svelte@3.58.0) + svelte: 3.59.1 + svelte-hmr: 0.15.1(svelte@3.59.1) vite: 4.3.9(@types/node@18.16.3) vitefu: 0.2.3(vite@4.3.9) transitivePeerDependencies: @@ -8093,14 +8097,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/svelte@3.2.2(svelte@3.58.0): + /@testing-library/svelte@3.2.2(svelte@3.59.1): resolution: {integrity: sha512-IKwZgqbekC3LpoRhSwhd0JswRGxKdAGkf39UiDXTywK61YyLXbCYoR831e/UUC6EeNW4hiHPY+2WuovxOgI5sw==} engines: {node: '>= 10'} peerDependencies: svelte: 3.x dependencies: '@testing-library/dom': 8.17.1 - svelte: 3.58.0 + svelte: 3.59.1 dev: true /@testing-library/user-event@13.5.0(@testing-library/dom@8.17.1): @@ -8247,7 +8251,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/eslint-scope@3.7.4: @@ -8489,19 +8493,19 @@ packages: /@types/react-dom@18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-dom@18.0.8: resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-is@17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react-test-renderer@17.0.2: @@ -8513,7 +8517,7 @@ packages: /@types/react-transition-group@4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react@17.0.49: @@ -8532,8 +8536,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react@18.2.7: - resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} + /@types/react@18.2.8: + resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9202,7 +9206,7 @@ packages: '@vue/compiler-core': 3.3.4 '@vue/compiler-dom': 3.3.4 '@vue/compiler-sfc': 3.3.4 - '@vue/reactivity': 3.2.47 + '@vue/reactivity': 3.3.4 '@vue/shared': 3.3.4 dev: true @@ -9654,13 +9658,13 @@ packages: vue-demi: 0.14.0(vue@3.2.39) dev: false - /@wdio/config@8.10.2: - resolution: {integrity: sha512-CBPyxay3vVlAnwF+Dv2zsM4QMOVg8rOiD1HAdm9BilwbID2RnLF5i0IYNIFsAblhSZQhXkn5BXAcFSEIVHwOgA==} + /@wdio/config@8.10.7: + resolution: {integrity: sha512-m7JX9X/RPM+4KZQkSUhPHXeS3PJJky0UB62ZLh28TYCzVxEKNq1gFb6Cvqfn+w6Ym/UCFBaZzDrRLLXUAgUifw==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 decamelize: 6.0.0 deepmerge-ts: 5.0.0 glob: 10.2.2 @@ -9682,6 +9686,16 @@ packages: read-pkg-up: 9.1.0 dev: true + /@wdio/logger@8.10.6: + resolution: {integrity: sha512-pJYKecNYS0vu0FxDaii6MYQlYkORDLGdRWi70hrihH20sMZofzMA1tvzRMRk1VTrsUUE4TLJXKdmT2JRMN+OPw==} + engines: {node: ^16.13 || >=18} + dependencies: + chalk: 5.2.0 + loglevel: 1.8.1 + loglevel-plugin-prefix: 0.8.4 + strip-ansi: 7.1.0 + dev: true + /@wdio/logger@8.6.6: resolution: {integrity: sha512-MS+Y5yqFGx2zVXMOfuBQAVdFsP4DuYz+/hM552xwiDWjGg6EZHoccqUYgH3J5zpu3JFpYV3R/a5jExFiGGck6g==} engines: {node: ^16.13 || >=18} @@ -9714,8 +9728,8 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/types@8.10.2: - resolution: {integrity: sha512-d0oWX82CVE4Z7ipD2GpPhaeFKh7JDaDNzgiQpPYkS74TBSqQV+yrqvqRlrmHD4nmRgFwnjtD8AFOo7ackeURhg==} + /@wdio/types@8.10.4: + resolution: {integrity: sha512-aLJ1QQW+hhALeRK3bvMLjIrlUVyhOs3Od+91pR4Z4pLwyeNG1bJZCJRD5bAJK/mm7CnFa0NsdixPS9jJxZcRrw==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 @@ -9728,12 +9742,12 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/utils@8.10.2: - resolution: {integrity: sha512-lMIqztb4Mmi2arsM089SDfubx9v0/a/7Ul+vMOt7P19ZEogiWnbELmIs/CaVOxjEcgaNjXM2s56ORKnAObJfgg==} + /@wdio/utils@8.10.7: + resolution: {integrity: sha512-G9r/bQl4J25WPKeW0e+27gqNvG+x7MyZEOICl6SwyBe0SqO7JBFOBARx4oUEp2zQYmnCRNtCrHa7yM/O4OPuKA==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 import-meta-resolve: 3.0.0 p-iteration: 1.1.8 dev: true @@ -10816,7 +10830,7 @@ packages: dependencies: '@babel/runtime': 7.18.9 cosmiconfig: 7.0.1 - resolve: 1.22.1 + resolve: 1.22.2 /babel-plugin-polyfill-corejs2@0.3.2(@babel/core@7.18.13): resolution: {integrity: sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==} @@ -11716,8 +11730,8 @@ packages: mitt: 3.0.0 dev: true - /chromium-bidi@0.4.7(devtools-protocol@0.0.1120988): - resolution: {integrity: sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==} + /chromium-bidi@0.4.9(devtools-protocol@0.0.1120988): + resolution: {integrity: sha512-u3DC6XwgLCA9QJ5ak1voPslCmacQdulZNCPsI3qNXxSnEcZS7DFIbww+5RM2bznMEje7cc0oydavRLRvOIZtHw==} peerDependencies: devtools-protocol: '*' dependencies: @@ -12252,6 +12266,14 @@ packages: transitivePeerDependencies: - encoding + /cross-fetch@3.1.6: + resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} + dependencies: + node-fetch: 2.6.11 + transitivePeerDependencies: + - encoding + dev: true + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -12924,28 +12946,28 @@ packages: resolution: {integrity: sha512-LF+0k1kYkrx2dZsvjLyNY2ySydz4lCy/xFvjuI5mCFGnepk5hC9iXbsdFk6jYma0ZvXaTxl3sGTiVr/GC0knyQ==} dev: true - /devtools-protocol@0.0.1138159: - resolution: {integrity: sha512-IVXe1ZEQJWkMkeg10hRoZu3luP054z8USOpBIyorCTTABKVg0gBGt4rmwjGmThMEKaTb4nEmjVJkZ3/YxU0whA==} + /devtools-protocol@0.0.1149535: + resolution: {integrity: sha512-vpM8tGaYz2nrN9n8rvUEhQCgU05ocejO5WIJySsftEHxUahQ/fWuNyPxXuQNBEmaISYyMZkxCunhjtSEyBl/Dg==} dev: true /devtools-protocol@0.0.981744: resolution: {integrity: sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==} dev: true - /devtools@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-pvnTf0GtY1ILgBBxjGpQmwmiIklPQFQNirW4deluoLnhKLt6ekdKjYRLoK7goNN0rYPx7R/KK6Aqe5mgWKxBaA==} + /devtools@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-picJDxsjpaOW7gnQjcQVGDXvxuP1RZ4VNJpvJ+qiy86Gf3l4FGLKYkpJJFAMsIugL0XPs89bIVhjbtIv5NGL1w==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 chrome-launcher: 0.15.1 edge-paths: 3.0.5 import-meta-resolve: 3.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 ua-parser-js: 1.0.34 uuid: 9.0.0 @@ -13935,7 +13957,7 @@ packages: dependencies: debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.11.0 - resolve: 1.22.1 + resolve: 1.22.2 transitivePeerDependencies: - supports-color dev: true @@ -14031,7 +14053,7 @@ packages: is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.6 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 tsconfig-paths: 3.14.1 transitivePeerDependencies: @@ -14098,7 +14120,7 @@ packages: ignore: 5.2.0 is-core-module: 2.11.0 minimatch: 3.1.2 - resolve: 1.22.1 + resolve: 1.22.2 semver: 7.3.8 dev: true @@ -15567,8 +15589,8 @@ packages: get-intrinsic: 1.2.0 dev: true - /got@12.6.0: - resolution: {integrity: sha512-WTcaQ963xV97MN3x0/CbAriXFZcXCfgxVp91I+Ze6pawQOa7SgzwSx2zIJJsX+kTajMnVs0xcFD1TxZKFqhdnQ==} + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} dependencies: '@sindresorhus/is': 5.3.0 @@ -15630,8 +15652,8 @@ packages: uglify-js: 3.17.0 dev: true - /happy-dom@9.1.9: - resolution: {integrity: sha512-OMbnoknA7iNNG/5fwt1JckCKc53QLLFo2ljzit1pCV9SC1TYwcQj0obq0QUTeqIf2p2skbFG69bo19YoSj/1DA==} + /happy-dom@9.10.7: + resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -15641,11 +15663,11 @@ packages: whatwg-mimetype: 3.0.0 dev: true - /happy-dom@9.10.7: - resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} + /happy-dom@9.20.3: + resolution: {integrity: sha512-eBsgauT435fXFvQDNcmm5QbGtYzxEzOaX35Ia+h6yP/wwa4xSWZh1CfP+mGby8Hk6Xu59mTkpyf72rUXHNxY7A==} dependencies: css.escape: 1.5.1 - he: 1.2.0 + entities: 4.5.0 iconv-lite: 0.6.3 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 @@ -17225,7 +17247,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) jest-util: 27.5.1 jest-validate: 27.5.1 - resolve: 1.22.1 + resolve: 1.22.2 resolve.exports: 1.1.1 slash: 3.0.0 dev: true @@ -18693,6 +18715,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.1: + resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true @@ -18976,12 +19005,6 @@ packages: big-integer: 1.6.51 dev: false - /nanoid@3.3.4: - resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: false - /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -19175,7 +19198,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -20253,7 +20276,7 @@ packages: resolution: {integrity: sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.4 + nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 dev: false @@ -20509,8 +20532,8 @@ packages: - utf-8-validate dev: true - /puppeteer-core@20.1.1(typescript@5.0.4): - resolution: {integrity: sha512-iB9F2Om8J+nU4qi30oYw0hMWOw6eQN7kFkLLI/u3UvxONOCx5o0KmM6+byaK2/QGIuQu2ly1mPaJnC1DyoW07Q==} + /puppeteer-core@20.3.0(typescript@5.0.4): + resolution: {integrity: sha512-264pBrIui5bO6NJeOcbJrLa0OCwmA4+WK00JMrLIKTfRiqe2gx8KWTzLsjyw/bizErp3TKS7vt/I0i5fTC+mAw==} engines: {node: '>=16.0.0'} peerDependencies: typescript: '>= 4.7.4' @@ -20518,17 +20541,12 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.0.1(typescript@5.0.4) - chromium-bidi: 0.4.7(devtools-protocol@0.0.1120988) - cross-fetch: 3.1.5 + '@puppeteer/browsers': 1.3.0(typescript@5.0.4) + chromium-bidi: 0.4.9(devtools-protocol@0.0.1120988) + cross-fetch: 3.1.6 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1120988 - extract-zip: 2.0.1(supports-color@8.1.1) - https-proxy-agent: 5.0.1 - proxy-from-env: 1.1.0 - tar-fs: 2.1.1 typescript: 5.0.4 - unbzip2-stream: 1.4.3 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -20725,7 +20743,7 @@ packages: estree-to-babel: 3.2.1 neo-async: 2.6.2 node-dir: 0.1.17 - resolve: 1.22.1 + resolve: 1.22.2 strip-indent: 3.0.0 transitivePeerDependencies: - supports-color @@ -21365,6 +21383,15 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} @@ -22345,7 +22372,7 @@ packages: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.0.1 + strip-ansi: 7.1.0 dev: true /string.prototype.matchall@4.0.7: @@ -22445,6 +22472,13 @@ packages: ansi-regex: 6.0.1 dev: true + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} engines: {node: '>=0.10.0'} @@ -22624,17 +22658,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr@0.15.1(svelte@3.58.0): + /svelte-hmr@0.15.1(svelte@3.59.1): resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.58.0 + svelte: 3.59.1 dev: true - /svelte@3.58.0: - resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} + /svelte@3.59.1: + resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} engines: {node: '>= 8'} dev: true @@ -23417,24 +23451,6 @@ packages: vfile: 4.2.1 dev: true - /unimport@1.3.0(rollup@3.20.2): - resolution: {integrity: sha512-fOkrdxglsHd428yegH0wPH/6IfaSdDeMXtdRGn6en/ccyzc2aaoxiUTMrJyc6Bu+xoa18RJRPMfLUHEzjz8atw==} - dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - escape-string-regexp: 5.0.0 - fast-glob: 3.2.12 - local-pkg: 0.4.3 - magic-string: 0.27.0 - mlly: 1.3.0 - pathe: 1.1.0 - pkg-types: 1.0.3 - scule: 1.0.0 - strip-literal: 1.0.1 - unplugin: 1.3.1 - transitivePeerDependencies: - - rollup - dev: true - /unimport@3.0.6(rollup@3.20.2): resolution: {integrity: sha512-GYxGJ1Bri1oqx8VFDjdgooGzeK7jBk3bvhXmamTIpu3nONOcUMGwZbX7X0L5RA7OWMXpR4vzpSQP7pXUzJg1/Q==} dependencies: @@ -23643,27 +23659,32 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import@0.12.1(rollup@3.20.2): - resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} + /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): + resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} engines: {node: '>=14'} peerDependencies: + '@nuxt/kit': ^3.2.2 '@vueuse/core': '*' peerDependenciesMeta: + '@nuxt/kit': + optional: true '@vueuse/core': optional: true dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 - magic-string: 0.27.0 - unimport: 1.3.0(rollup@3.20.2) + magic-string: 0.30.0 + minimatch: 9.0.0 + unimport: 3.0.6(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): - resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} + /unplugin-auto-import@0.16.4(rollup@3.20.2): + resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -23674,38 +23695,39 @@ packages: '@vueuse/core': optional: true dependencies: - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.0 - unimport: 3.0.6(rollup@3.20.2) + minimatch: 9.0.1 + unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-vue-components@0.22.12(rollup@3.20.2)(vue@3.3.4): - resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} + /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 + '@nuxt/kit': ^3.2.2 vue: 2 || 3 peerDependenciesMeta: '@babel/parser': optional: true + '@nuxt/kit': + optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.2(rollup@2.79.1) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 - magic-string: 0.27.0 - minimatch: 5.1.1 + magic-string: 0.30.0 + minimatch: 7.4.2 resolve: 1.22.1 - unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 vue: 3.3.4 transitivePeerDependencies: @@ -23713,7 +23735,7 @@ packages: - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: @@ -23727,7 +23749,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@2.79.1) + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 @@ -23736,14 +23758,14 @@ packages: minimatch: 7.4.2 resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.3.4 + vue: 3.2.47 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): - resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} + /unplugin-vue-components@0.25.0(rollup@3.20.2)(vue@3.3.4): + resolution: {integrity: sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 @@ -23755,17 +23777,17 @@ packages: '@nuxt/kit': optional: true dependencies: - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 7.4.2 - resolve: 1.22.1 + minimatch: 9.0.1 + resolve: 1.22.2 unplugin: 1.3.1 - vue: 3.2.47 + vue: 3.3.4 transitivePeerDependencies: - rollup - supports-color @@ -24469,19 +24491,19 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /webdriver@8.10.2: - resolution: {integrity: sha512-xwoY+JtmEwN9hFx00V08PBlLLbuOHnPcO78ImPn6IzlhDW960f/6C8fzP0oiJkDyjQ7U81gHU6Mjkp/tBNpKEQ==} + /webdriver@8.10.7: + resolution: {integrity: sha512-pBy29S9e8IYKYHfS0gp91Jp9SUvXJQckJKJdj+VNLNL9toSFo10N7xRpv8W1f7HkniXrgESi9GHYNyc1J/5lLA==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 '@types/ws': 8.5.4 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 deepmerge-ts: 5.0.0 - got: 12.6.0 + got: 12.6.1 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24501,7 +24523,7 @@ packages: '@wdio/types': 8.8.7 '@wdio/utils': 8.8.7 deepmerge-ts: 5.0.0 - got: 12.6.0 + got: 12.6.1 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24509,35 +24531,35 @@ packages: - utf-8-validate dev: true - /webdriverio@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-VrA9oFI17sBhPDvMwywve4CwODHi5FEzjn9gyInN7Nv+6tVaDC+PVGsKV7ZQQSj5C0bzPCn3IgXSoM1Qqn3XeQ==} + /webdriverio@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-TkkPE3zBxdLRdcsNLqHct2OARnfMYB9/A0ri4sccmc3C3dVFiW99NAstN88nzD1SYzXAbxALRuITVd5oswqqhg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 '@wdio/repl': 8.10.1 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 archiver: 5.3.1 aria-query: 5.0.2 css-shorthand-properties: 1.1.1 css-value: 0.0.1 - devtools: 8.10.2(typescript@5.0.4) - devtools-protocol: 0.0.1138159 + devtools: 8.10.7(typescript@5.0.4) + devtools-protocol: 0.0.1149535 grapheme-splitter: 1.0.4 import-meta-resolve: 3.0.0 is-plain-obj: 4.1.0 lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 - minimatch: 9.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + minimatch: 9.0.1 + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 serialize-error: 8.1.0 - webdriver: 8.10.2 + webdriver: 8.10.7 transitivePeerDependencies: - bufferutil - encoding diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap deleted file mode 100644 index 244facca8a52..000000000000 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ /dev/null @@ -1,321 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`expect.soft > basic 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > basic -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:24:18 - 22| - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - | ^ - 25| expect.soft(2).toBe(3) - 26| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > basic -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:25:18 - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - 25| expect.soft(2).toBe(3) - | ^ - 26| }) - 27| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ - -" -`; - -exports[`expect.soft > promise 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > promise -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:29:3 - 27| - 28| test('promise', async () => { - 29| await expect.soft( - | ^ - 30| new Promise((resolve) => { - 31| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ - - FAIL |core| soft.test.ts > promise -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:36:3 - 34| }), - 35| ).resolves.toBe(2) - 36| await expect.soft( - | ^ - 37| new Promise((resolve) => { - 38| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ - -" -`; - -exports[`expect.soft > retry will failed 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 1 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 1 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 2 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 2 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 3 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 3 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 4 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 4 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯ - -" -`; - -exports[`expect.soft > with expect 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > with expect -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:46:18 - 44| - 45| test('with expect', () => { - 46| expect.soft(1).toEqual(2) - | ^ - 47| expect(10).toEqual(20) - 48| expect.soft(2).toEqual(3) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/5]⎯ - - FAIL |core| soft.test.ts > with expect -AssertionError: expected 10 to deeply equal 20 - - - Expected - 0 - + Received + 1 - - - 20 - + 10 - - ❯ soft.test.ts:47:14 - 45| test('with expect', () => { - 46| expect.soft(1).toEqual(2) - 47| expect(10).toEqual(20) - | ^ - 48| expect.soft(2).toEqual(3) - 49| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/5]⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:52:18 - 50| - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - | ^ - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/5]⎯ - - FAIL |core| soft.test.ts > with expect.extend -Error: expected 3 to be divisible by 4 - ❯ soft.test.ts:53:27 - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - | ^ - 54| expect(5).toEqual(6) - 55| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/5]⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 5 to deeply equal 6 - - - Expected - 0 - + Received + 1 - - - 6 - + 5 - - ❯ soft.test.ts:54:13 - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - | ^ - 55| }) - 56| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/5]⎯ - -" -`; - -exports[`expect.soft > with expect.extend 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:52:18 - 50| - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - | ^ - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯ - - FAIL |core| soft.test.ts > with expect.extend -Error: expected 3 to be divisible by 4 - ❯ soft.test.ts:53:27 - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - | ^ - 54| expect(5).toEqual(6) - 55| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 5 to deeply equal 6 - - - Expected - 0 - + Received + 1 - - - 6 - + 5 - - ❯ soft.test.ts:54:13 - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - | ^ - 55| }) - 56| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯ - -" -`; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 1a49e8c6be8f..22f6119c62c0 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -10,14 +10,12 @@ describe('expect.soft', () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to be 2') expect(stderr).toContain('AssertionError: expected 2 to be 3') - expect(stderr).toMatchSnapshot() }) test('promise', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 2 to be 3') expect(stderr).toContain('AssertionError: expected 1 to be 2') - expect(stderr).toMatchSnapshot() }) test('with expect', async () => { @@ -25,7 +23,6 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') expect(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') - expect(stderr).toMatchSnapshot() }) test('with expect.extend', async () => { @@ -33,17 +30,16 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') expect(stderr).toContain('Error: expected 3 to be divisible by 4') expect(stderr).toContain('AssertionError: expected 5 to deeply equal 6') - expect(stderr).toMatchSnapshot() }) test('passed', async () => { const { stdout } = await run() - expect(stdout).toContain('1 passed') + expect(stdout).toContain('✓ soft.test.ts > passed') }) test('retry will passed', async () => { const { stdout } = await run() - expect(stdout).toContain('1 passed') + expect(stdout).toContain('✓ soft.test.ts > retry will passed') }) test('retry will failed', async () => { @@ -52,6 +48,6 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 2 to be 5') expect(stderr).toContain('AssertionError: expected 3 to be 4') expect(stderr).toContain('AssertionError: expected 4 to be 5') - expect(stderr).toMatchSnapshot() + expect(stderr).toContain('4/4') }) }) From 8a2b0d451bd5026563cc261487d967ad81d49bed Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 14:25:59 +0000 Subject: [PATCH 14/39] test: update snapshot --- .../test/__snapshots__/expect.test.ts.snap | 247 ++++++++++++++++++ test/core/test/expect.test.ts | 7 + test/core/test/fixtures/expects/soft.test.ts | 2 +- 3 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 test/core/test/__snapshots__/expect.test.ts.snap diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap new file mode 100644 index 000000000000..93c796b7c8c0 --- /dev/null +++ b/test/core/test/__snapshots__/expect.test.ts.snap @@ -0,0 +1,247 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`expect.soft > snapshot 1`] = ` +"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯ + + FAIL |core| soft.test.ts > basic +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:24:18 + 22| + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) + | ^ + 25| expect.soft(2).toBe(3) + 26| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/13]⎯ + + FAIL |core| soft.test.ts > basic +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:25:18 + 23| test('basic', () => { + 24| expect.soft(1).toBe(2) + 25| expect.soft(2).toBe(3) + | ^ + 26| }) + 27| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/13]⎯ + + FAIL |core| soft.test.ts > promise +AssertionError: expected 1 to be 2 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:29:3 + 27| + 28| test('promise', async () => { + 29| await expect.soft( + | ^ + 30| new Promise((resolve) => { + 31| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/13]⎯ + + FAIL |core| soft.test.ts > promise +AssertionError: expected 2 to be 3 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 3 + + 2 + + ❯ soft.test.ts:36:3 + 34| }), + 35| ).resolves.toBe(2) + 36| await expect.soft( + | ^ + 37| new Promise((resolve) => { + 38| setTimeout(() => { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/13]⎯ + + FAIL |core| soft.test.ts > with expect +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:46:18 + 44| + 45| test('with expect', () => { + 46| expect.soft(1).toEqual(2) + | ^ + 47| expect(10).toEqual(20) + 48| expect.soft(2).toEqual(3) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/13]⎯ + + FAIL |core| soft.test.ts > with expect +AssertionError: expected 10 to deeply equal 20 + + - Expected - 0 + + Received + 1 + + - 20 + + 10 + + ❯ soft.test.ts:47:14 + 45| test('with expect', () => { + 46| expect.soft(1).toEqual(2) + 47| expect(10).toEqual(20) + | ^ + 48| expect.soft(2).toEqual(3) + 49| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/13]⎯ + + FAIL |core| soft.test.ts > with expect.extend +AssertionError: expected 1 to deeply equal 2 + + - Expected - 0 + + Received + 1 + + - 2 + + 1 + + ❯ soft.test.ts:52:18 + 50| + 51| test('with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + | ^ + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/13]⎯ + + FAIL |core| soft.test.ts > with expect.extend +Error: expected 3 to be divisible by 4 + ❯ soft.test.ts:53:27 + 51| test('with expect.extend', () => { + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + | ^ + 54| expect(5).toEqual(6) + 55| }) + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/13]⎯ + + FAIL |core| soft.test.ts > with expect.extend +AssertionError: expected 5 to deeply equal 6 + + - Expected - 0 + + Received + 1 + + - 6 + + 5 + + ❯ soft.test.ts:54:13 + 52| expect.soft(1).toEqual(2); + 53| (expect.soft(3) as any).toBeDividedBy(4) + 54| expect(5).toEqual(6) + | ^ + 55| }) + 56| + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/13]⎯ + + FAIL |core| soft.test.ts > retry will failed +AssertionError: expected 5 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 5 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + | ^ + 74| expect.soft(num += 1).toBe(5) + 75| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/13]⎯ + + FAIL |core| soft.test.ts > retry will failed +AssertionError: expected 6 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 6 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) + | ^ + 75| }, { + 76| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/13]⎯ + + FAIL |core| soft.test.ts > retry will failed +AssertionError: expected 7 to be 4 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 4 + + 7 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 + 71| num = 0 + 72| test('retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + | ^ + 74| expect.soft(num += 1).toBe(5) + 75| }, { + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/13]⎯ + + FAIL |core| soft.test.ts > retry will failed +AssertionError: expected 8 to be 5 // Object.is equality + + - Expected - 0 + + Received + 1 + + - 5 + + 8 + + ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 + 72| test('retry will failed', () => { + 73| expect.soft(num += 1).toBe(4) + 74| expect.soft(num += 1).toBe(5) + | ^ + 75| }, { + 76| retry: 2, + +⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/13]⎯ + +" +`; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 22f6119c62c0..abc4bf88b159 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -50,4 +50,11 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 4 to be 5') expect(stderr).toContain('4/4') }) + + test('snapshot', async () => { + const { stderr } = await run({ + testNamePattern: '', + }) + expect(stderr).toMatchSnapshot() + }) }) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index 2ae52263cb73..e910ed11435e 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -40,7 +40,7 @@ test('promise', async () => { }) }), ).resolves.toBe(3) -}) +}, 5000) test('with expect', () => { expect.soft(1).toEqual(2) From cb64a2b729cafc0491a6bd7630017ed8e3ffece3 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 17:09:27 +0000 Subject: [PATCH 15/39] chore: revert lock file --- pnpm-lock.yaml | 326 +++++++++++++++++++++++-------------------------- 1 file changed, 152 insertions(+), 174 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a75fc37c695c..a65e911d3eaa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,7 +325,7 @@ importers: version: 20.2.5 '@types/react': specifier: latest - version: 18.2.8 + version: 18.2.7 '@vitejs/plugin-react': specifier: latest version: 4.0.0(vite@4.3.9) @@ -392,7 +392,7 @@ importers: version: link:../../packages/ui happy-dom: specifier: latest - version: 9.20.3 + version: 9.1.9 jsdom: specifier: latest version: 22.1.0 @@ -731,10 +731,10 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.0 - version: 2.0.0(svelte@3.59.1)(vite@4.3.9) + version: 2.0.0(svelte@3.58.0)(vite@4.3.9) '@testing-library/svelte': specifier: ^3.2.2 - version: 3.2.2(svelte@3.59.1) + version: 3.2.2(svelte@3.58.0) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -743,7 +743,7 @@ importers: version: 22.1.0 svelte: specifier: latest - version: 3.59.1 + version: 3.58.0 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -768,10 +768,10 @@ importers: version: 22.1.0 unplugin-auto-import: specifier: latest - version: 0.16.4(rollup@3.20.2) + version: 0.12.1(rollup@3.20.2) unplugin-vue-components: specifier: latest - version: 0.25.0(rollup@3.20.2)(vue@3.3.4) + version: 0.22.12(rollup@3.20.2)(vue@3.3.4) vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -1416,7 +1416,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/base: devDependencies: @@ -1530,7 +1530,7 @@ importers: version: 2.3.2(vue@3.3.4) happy-dom: specifier: latest - version: 9.20.3 + version: 9.1.9 istanbul-lib-coverage: specifier: ^3.2.0 version: 3.2.0 @@ -1545,7 +1545,7 @@ importers: version: 3.3.4 webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/css: devDependencies: @@ -1810,7 +1810,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/web-worker: devDependencies: @@ -2083,10 +2083,6 @@ packages: resolution: {integrity: sha512-vy9fM3pIxZmX07dL+VX1aZe7ynZ+YyB0jY+jE6r3hOK6GNY2t6W8rzpFC4tgpbXUYABkFQwgJq2XYXlxbXAI0g==} dev: true - /@antfu/utils@0.7.4: - resolution: {integrity: sha512-qe8Nmh9rYI/HIspLSTwtbMFPj6dISG6+dJnOguTlPNXtCvS2uezdxscVBb7/3DrmNbQK49TDqpkSQ1chbRGdpQ==} - dev: true - /@apideck/better-ajv-errors@0.3.6(ajv@8.11.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2163,7 +2159,7 @@ packages: gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 - resolve: 1.22.2 + resolve: 1.22.1 semver: 5.7.1 source-map: 0.5.7 transitivePeerDependencies: @@ -2413,7 +2409,7 @@ packages: '@babel/traverse': 7.21.4 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2429,7 +2425,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2445,7 +2441,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -5481,7 +5477,7 @@ packages: resolution: {integrity: sha512-6MvDI+I6QMvXn5rK9KQGdpEE4mmLTcuQdLZEiX5N+uZB+vc4Yw9K1OtnOgkl8mp4d9X0UrILREyZgF1NUwUt+Q==} dependencies: '@antfu/install-pkg': 0.1.1 - '@antfu/utils': 0.7.4 + '@antfu/utils': 0.7.2 '@iconify/types': 2.0.0 debug: 4.3.4(supports-color@8.1.1) kolorist: 1.7.0 @@ -6344,8 +6340,8 @@ packages: - supports-color dev: true - /@puppeteer/browsers@1.3.0(typescript@5.0.4): - resolution: {integrity: sha512-an3QdbNPkuU6qpxpbssxAbjRLJcF+eP4L8UqIY3+6n0sbaVxw5pz7PiCLy9g32XEZuoamUlV5ZQPnA6FxvkIHA==} + /@puppeteer/browsers@1.0.1(typescript@5.0.4): + resolution: {integrity: sha512-9wkYhON9zBgtjYRE3FcokGCfjG25zjzNAYmsHpiWitRZ/4DeT3v125/fCUU66SaPJ4nUsxGNPgpS1TOcQ+8StA==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -6452,7 +6448,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.22.2 + resolve: 1.22.1 rollup: 2.79.1 dev: true @@ -7961,7 +7957,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.59.1)(vite@4.3.9): + /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.58.0)(vite@4.3.9): resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -7972,8 +7968,8 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.27.0 - svelte: 3.59.1 - svelte-hmr: 0.15.1(svelte@3.59.1) + svelte: 3.58.0 + svelte-hmr: 0.15.1(svelte@3.58.0) vite: 4.3.9(@types/node@18.16.3) vitefu: 0.2.3(vite@4.3.9) transitivePeerDependencies: @@ -8097,14 +8093,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/svelte@3.2.2(svelte@3.59.1): + /@testing-library/svelte@3.2.2(svelte@3.58.0): resolution: {integrity: sha512-IKwZgqbekC3LpoRhSwhd0JswRGxKdAGkf39UiDXTywK61YyLXbCYoR831e/UUC6EeNW4hiHPY+2WuovxOgI5sw==} engines: {node: '>= 10'} peerDependencies: svelte: 3.x dependencies: '@testing-library/dom': 8.17.1 - svelte: 3.59.1 + svelte: 3.58.0 dev: true /@testing-library/user-event@13.5.0(@testing-library/dom@8.17.1): @@ -8251,7 +8247,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/eslint-scope@3.7.4: @@ -8493,19 +8489,19 @@ packages: /@types/react-dom@18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/react-dom@18.0.8: resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/react-is@17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: false /@types/react-test-renderer@17.0.2: @@ -8517,7 +8513,7 @@ packages: /@types/react-transition-group@4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: false /@types/react@17.0.49: @@ -8536,8 +8532,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react@18.2.8: - resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} + /@types/react@18.2.7: + resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9206,7 +9202,7 @@ packages: '@vue/compiler-core': 3.3.4 '@vue/compiler-dom': 3.3.4 '@vue/compiler-sfc': 3.3.4 - '@vue/reactivity': 3.3.4 + '@vue/reactivity': 3.2.47 '@vue/shared': 3.3.4 dev: true @@ -9658,13 +9654,13 @@ packages: vue-demi: 0.14.0(vue@3.2.39) dev: false - /@wdio/config@8.10.7: - resolution: {integrity: sha512-m7JX9X/RPM+4KZQkSUhPHXeS3PJJky0UB62ZLh28TYCzVxEKNq1gFb6Cvqfn+w6Ym/UCFBaZzDrRLLXUAgUifw==} + /@wdio/config@8.10.2: + resolution: {integrity: sha512-CBPyxay3vVlAnwF+Dv2zsM4QMOVg8rOiD1HAdm9BilwbID2RnLF5i0IYNIFsAblhSZQhXkn5BXAcFSEIVHwOgA==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.10.6 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/logger': 8.6.6 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 decamelize: 6.0.0 deepmerge-ts: 5.0.0 glob: 10.2.2 @@ -9686,16 +9682,6 @@ packages: read-pkg-up: 9.1.0 dev: true - /@wdio/logger@8.10.6: - resolution: {integrity: sha512-pJYKecNYS0vu0FxDaii6MYQlYkORDLGdRWi70hrihH20sMZofzMA1tvzRMRk1VTrsUUE4TLJXKdmT2JRMN+OPw==} - engines: {node: ^16.13 || >=18} - dependencies: - chalk: 5.2.0 - loglevel: 1.8.1 - loglevel-plugin-prefix: 0.8.4 - strip-ansi: 7.1.0 - dev: true - /@wdio/logger@8.6.6: resolution: {integrity: sha512-MS+Y5yqFGx2zVXMOfuBQAVdFsP4DuYz+/hM552xwiDWjGg6EZHoccqUYgH3J5zpu3JFpYV3R/a5jExFiGGck6g==} engines: {node: ^16.13 || >=18} @@ -9728,8 +9714,8 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/types@8.10.4: - resolution: {integrity: sha512-aLJ1QQW+hhALeRK3bvMLjIrlUVyhOs3Od+91pR4Z4pLwyeNG1bJZCJRD5bAJK/mm7CnFa0NsdixPS9jJxZcRrw==} + /@wdio/types@8.10.2: + resolution: {integrity: sha512-d0oWX82CVE4Z7ipD2GpPhaeFKh7JDaDNzgiQpPYkS74TBSqQV+yrqvqRlrmHD4nmRgFwnjtD8AFOo7ackeURhg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 @@ -9742,12 +9728,12 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/utils@8.10.7: - resolution: {integrity: sha512-G9r/bQl4J25WPKeW0e+27gqNvG+x7MyZEOICl6SwyBe0SqO7JBFOBARx4oUEp2zQYmnCRNtCrHa7yM/O4OPuKA==} + /@wdio/utils@8.10.2: + resolution: {integrity: sha512-lMIqztb4Mmi2arsM089SDfubx9v0/a/7Ul+vMOt7P19ZEogiWnbELmIs/CaVOxjEcgaNjXM2s56ORKnAObJfgg==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.10.6 - '@wdio/types': 8.10.4 + '@wdio/logger': 8.6.6 + '@wdio/types': 8.10.2 import-meta-resolve: 3.0.0 p-iteration: 1.1.8 dev: true @@ -10830,7 +10816,7 @@ packages: dependencies: '@babel/runtime': 7.18.9 cosmiconfig: 7.0.1 - resolve: 1.22.2 + resolve: 1.22.1 /babel-plugin-polyfill-corejs2@0.3.2(@babel/core@7.18.13): resolution: {integrity: sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==} @@ -11730,8 +11716,8 @@ packages: mitt: 3.0.0 dev: true - /chromium-bidi@0.4.9(devtools-protocol@0.0.1120988): - resolution: {integrity: sha512-u3DC6XwgLCA9QJ5ak1voPslCmacQdulZNCPsI3qNXxSnEcZS7DFIbww+5RM2bznMEje7cc0oydavRLRvOIZtHw==} + /chromium-bidi@0.4.7(devtools-protocol@0.0.1120988): + resolution: {integrity: sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==} peerDependencies: devtools-protocol: '*' dependencies: @@ -12266,14 +12252,6 @@ packages: transitivePeerDependencies: - encoding - /cross-fetch@3.1.6: - resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} - dependencies: - node-fetch: 2.6.11 - transitivePeerDependencies: - - encoding - dev: true - /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -12946,28 +12924,28 @@ packages: resolution: {integrity: sha512-LF+0k1kYkrx2dZsvjLyNY2ySydz4lCy/xFvjuI5mCFGnepk5hC9iXbsdFk6jYma0ZvXaTxl3sGTiVr/GC0knyQ==} dev: true - /devtools-protocol@0.0.1149535: - resolution: {integrity: sha512-vpM8tGaYz2nrN9n8rvUEhQCgU05ocejO5WIJySsftEHxUahQ/fWuNyPxXuQNBEmaISYyMZkxCunhjtSEyBl/Dg==} + /devtools-protocol@0.0.1138159: + resolution: {integrity: sha512-IVXe1ZEQJWkMkeg10hRoZu3luP054z8USOpBIyorCTTABKVg0gBGt4rmwjGmThMEKaTb4nEmjVJkZ3/YxU0whA==} dev: true /devtools-protocol@0.0.981744: resolution: {integrity: sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==} dev: true - /devtools@8.10.7(typescript@5.0.4): - resolution: {integrity: sha512-picJDxsjpaOW7gnQjcQVGDXvxuP1RZ4VNJpvJ+qiy86Gf3l4FGLKYkpJJFAMsIugL0XPs89bIVhjbtIv5NGL1w==} + /devtools@8.10.2(typescript@5.0.4): + resolution: {integrity: sha512-pvnTf0GtY1ILgBBxjGpQmwmiIklPQFQNirW4deluoLnhKLt6ekdKjYRLoK7goNN0rYPx7R/KK6Aqe5mgWKxBaA==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 chrome-launcher: 0.15.1 edge-paths: 3.0.5 import-meta-resolve: 3.0.0 - puppeteer-core: 20.3.0(typescript@5.0.4) + puppeteer-core: 20.1.1(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 ua-parser-js: 1.0.34 uuid: 9.0.0 @@ -13957,7 +13935,7 @@ packages: dependencies: debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.11.0 - resolve: 1.22.2 + resolve: 1.22.1 transitivePeerDependencies: - supports-color dev: true @@ -14053,7 +14031,7 @@ packages: is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.6 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 tsconfig-paths: 3.14.1 transitivePeerDependencies: @@ -14120,7 +14098,7 @@ packages: ignore: 5.2.0 is-core-module: 2.11.0 minimatch: 3.1.2 - resolve: 1.22.2 + resolve: 1.22.1 semver: 7.3.8 dev: true @@ -15589,8 +15567,8 @@ packages: get-intrinsic: 1.2.0 dev: true - /got@12.6.1: - resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + /got@12.6.0: + resolution: {integrity: sha512-WTcaQ963xV97MN3x0/CbAriXFZcXCfgxVp91I+Ze6pawQOa7SgzwSx2zIJJsX+kTajMnVs0xcFD1TxZKFqhdnQ==} engines: {node: '>=14.16'} dependencies: '@sindresorhus/is': 5.3.0 @@ -15652,8 +15630,8 @@ packages: uglify-js: 3.17.0 dev: true - /happy-dom@9.10.7: - resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} + /happy-dom@9.1.9: + resolution: {integrity: sha512-OMbnoknA7iNNG/5fwt1JckCKc53QLLFo2ljzit1pCV9SC1TYwcQj0obq0QUTeqIf2p2skbFG69bo19YoSj/1DA==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -15663,11 +15641,11 @@ packages: whatwg-mimetype: 3.0.0 dev: true - /happy-dom@9.20.3: - resolution: {integrity: sha512-eBsgauT435fXFvQDNcmm5QbGtYzxEzOaX35Ia+h6yP/wwa4xSWZh1CfP+mGby8Hk6Xu59mTkpyf72rUXHNxY7A==} + /happy-dom@9.10.7: + resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} dependencies: css.escape: 1.5.1 - entities: 4.5.0 + he: 1.2.0 iconv-lite: 0.6.3 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 @@ -17247,7 +17225,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) jest-util: 27.5.1 jest-validate: 27.5.1 - resolve: 1.22.2 + resolve: 1.22.1 resolve.exports: 1.1.1 slash: 3.0.0 dev: true @@ -18715,13 +18693,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true @@ -19005,6 +18976,12 @@ packages: big-integer: 1.6.51 dev: false + /nanoid@3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: false + /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -19198,7 +19175,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 + resolve: 1.22.1 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -20276,7 +20253,7 @@ packages: resolution: {integrity: sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.4 picocolors: 1.0.0 source-map-js: 1.0.2 dev: false @@ -20532,8 +20509,8 @@ packages: - utf-8-validate dev: true - /puppeteer-core@20.3.0(typescript@5.0.4): - resolution: {integrity: sha512-264pBrIui5bO6NJeOcbJrLa0OCwmA4+WK00JMrLIKTfRiqe2gx8KWTzLsjyw/bizErp3TKS7vt/I0i5fTC+mAw==} + /puppeteer-core@20.1.1(typescript@5.0.4): + resolution: {integrity: sha512-iB9F2Om8J+nU4qi30oYw0hMWOw6eQN7kFkLLI/u3UvxONOCx5o0KmM6+byaK2/QGIuQu2ly1mPaJnC1DyoW07Q==} engines: {node: '>=16.0.0'} peerDependencies: typescript: '>= 4.7.4' @@ -20541,12 +20518,17 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.3.0(typescript@5.0.4) - chromium-bidi: 0.4.9(devtools-protocol@0.0.1120988) - cross-fetch: 3.1.6 + '@puppeteer/browsers': 1.0.1(typescript@5.0.4) + chromium-bidi: 0.4.7(devtools-protocol@0.0.1120988) + cross-fetch: 3.1.5 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1120988 + extract-zip: 2.0.1(supports-color@8.1.1) + https-proxy-agent: 5.0.1 + proxy-from-env: 1.1.0 + tar-fs: 2.1.1 typescript: 5.0.4 + unbzip2-stream: 1.4.3 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -20743,7 +20725,7 @@ packages: estree-to-babel: 3.2.1 neo-async: 2.6.2 node-dir: 0.1.17 - resolve: 1.22.2 + resolve: 1.22.1 strip-indent: 3.0.0 transitivePeerDependencies: - supports-color @@ -21383,15 +21365,6 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} - hasBin: true - dependencies: - is-core-module: 2.11.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} @@ -22372,7 +22345,7 @@ packages: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.1.0 + strip-ansi: 7.0.1 dev: true /string.prototype.matchall@4.0.7: @@ -22472,13 +22445,6 @@ packages: ansi-regex: 6.0.1 dev: true - /strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} engines: {node: '>=0.10.0'} @@ -22658,17 +22624,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr@0.15.1(svelte@3.59.1): + /svelte-hmr@0.15.1(svelte@3.58.0): resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.59.1 + svelte: 3.58.0 dev: true - /svelte@3.59.1: - resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} + /svelte@3.58.0: + resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} engines: {node: '>= 8'} dev: true @@ -23451,6 +23417,24 @@ packages: vfile: 4.2.1 dev: true + /unimport@1.3.0(rollup@3.20.2): + resolution: {integrity: sha512-fOkrdxglsHd428yegH0wPH/6IfaSdDeMXtdRGn6en/ccyzc2aaoxiUTMrJyc6Bu+xoa18RJRPMfLUHEzjz8atw==} + dependencies: + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + escape-string-regexp: 5.0.0 + fast-glob: 3.2.12 + local-pkg: 0.4.3 + magic-string: 0.27.0 + mlly: 1.3.0 + pathe: 1.1.0 + pkg-types: 1.0.3 + scule: 1.0.0 + strip-literal: 1.0.1 + unplugin: 1.3.1 + transitivePeerDependencies: + - rollup + dev: true + /unimport@3.0.6(rollup@3.20.2): resolution: {integrity: sha512-GYxGJ1Bri1oqx8VFDjdgooGzeK7jBk3bvhXmamTIpu3nONOcUMGwZbX7X0L5RA7OWMXpR4vzpSQP7pXUzJg1/Q==} dependencies: @@ -23659,32 +23643,27 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): - resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} + /unplugin-auto-import@0.12.1(rollup@3.20.2): + resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} engines: {node: '>=14'} peerDependencies: - '@nuxt/kit': ^3.2.2 '@vueuse/core': '*' peerDependenciesMeta: - '@nuxt/kit': - optional: true '@vueuse/core': optional: true dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 - magic-string: 0.30.0 - minimatch: 9.0.0 - unimport: 3.0.6(rollup@3.20.2) + magic-string: 0.27.0 + unimport: 1.3.0(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-auto-import@0.16.4(rollup@3.20.2): - resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==} + /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): + resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -23695,39 +23674,38 @@ packages: '@vueuse/core': optional: true dependencies: - '@antfu/utils': 0.7.4 + '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.1 - unimport: 3.0.7(rollup@3.20.2) + minimatch: 9.0.0 + unimport: 3.0.6(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): - resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} + /unplugin-vue-components@0.22.12(rollup@3.20.2)(vue@3.3.4): + resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 - '@nuxt/kit': ^3.2.2 vue: 2 || 3 peerDependenciesMeta: '@babel/parser': optional: true - '@nuxt/kit': - optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@2.79.1) + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 - magic-string: 0.30.0 - minimatch: 7.4.2 + magic-string: 0.27.0 + minimatch: 5.1.1 resolve: 1.22.1 + unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 vue: 3.3.4 transitivePeerDependencies: @@ -23735,7 +23713,7 @@ packages: - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): + /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: @@ -23749,7 +23727,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.2(rollup@2.79.1) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 @@ -23758,14 +23736,14 @@ packages: minimatch: 7.4.2 resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.2.47 + vue: 3.3.4 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin-vue-components@0.25.0(rollup@3.20.2)(vue@3.3.4): - resolution: {integrity: sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==} + /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): + resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 @@ -23777,17 +23755,17 @@ packages: '@nuxt/kit': optional: true dependencies: - '@antfu/utils': 0.7.4 + '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.1 - resolve: 1.22.2 + minimatch: 7.4.2 + resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.3.4 + vue: 3.2.47 transitivePeerDependencies: - rollup - supports-color @@ -24491,19 +24469,19 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /webdriver@8.10.7: - resolution: {integrity: sha512-pBy29S9e8IYKYHfS0gp91Jp9SUvXJQckJKJdj+VNLNL9toSFo10N7xRpv8W1f7HkniXrgESi9GHYNyc1J/5lLA==} + /webdriver@8.10.2: + resolution: {integrity: sha512-xwoY+JtmEwN9hFx00V08PBlLLbuOHnPcO78ImPn6IzlhDW960f/6C8fzP0oiJkDyjQ7U81gHU6Mjkp/tBNpKEQ==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 '@types/ws': 8.5.4 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 deepmerge-ts: 5.0.0 - got: 12.6.1 + got: 12.6.0 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24523,7 +24501,7 @@ packages: '@wdio/types': 8.8.7 '@wdio/utils': 8.8.7 deepmerge-ts: 5.0.0 - got: 12.6.1 + got: 12.6.0 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24531,35 +24509,35 @@ packages: - utf-8-validate dev: true - /webdriverio@8.10.7(typescript@5.0.4): - resolution: {integrity: sha512-TkkPE3zBxdLRdcsNLqHct2OARnfMYB9/A0ri4sccmc3C3dVFiW99NAstN88nzD1SYzXAbxALRuITVd5oswqqhg==} + /webdriverio@8.10.2(typescript@5.0.4): + resolution: {integrity: sha512-VrA9oFI17sBhPDvMwywve4CwODHi5FEzjn9gyInN7Nv+6tVaDC+PVGsKV7ZQQSj5C0bzPCn3IgXSoM1Qqn3XeQ==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 '@wdio/repl': 8.10.1 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 archiver: 5.3.1 aria-query: 5.0.2 css-shorthand-properties: 1.1.1 css-value: 0.0.1 - devtools: 8.10.7(typescript@5.0.4) - devtools-protocol: 0.0.1149535 + devtools: 8.10.2(typescript@5.0.4) + devtools-protocol: 0.0.1138159 grapheme-splitter: 1.0.4 import-meta-resolve: 3.0.0 is-plain-obj: 4.1.0 lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 - minimatch: 9.0.1 - puppeteer-core: 20.3.0(typescript@5.0.4) + minimatch: 9.0.0 + puppeteer-core: 20.1.1(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 serialize-error: 8.1.0 - webdriver: 8.10.7 + webdriver: 8.10.2 transitivePeerDependencies: - bufferutil - encoding From a90e3eab2f02b7b582e95076ae99a4935a30b138 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 17:17:48 +0000 Subject: [PATCH 16/39] test: remove snapshot --- .../test/__snapshots__/expect.test.ts.snap | 247 ------------------ test/core/test/expect.test.ts | 7 - 2 files changed, 254 deletions(-) delete mode 100644 test/core/test/__snapshots__/expect.test.ts.snap diff --git a/test/core/test/__snapshots__/expect.test.ts.snap b/test/core/test/__snapshots__/expect.test.ts.snap deleted file mode 100644 index 93c796b7c8c0..000000000000 --- a/test/core/test/__snapshots__/expect.test.ts.snap +++ /dev/null @@ -1,247 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`expect.soft > snapshot 1`] = ` -"⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯ - - FAIL |core| soft.test.ts > basic -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:24:18 - 22| - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - | ^ - 25| expect.soft(2).toBe(3) - 26| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/13]⎯ - - FAIL |core| soft.test.ts > basic -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:25:18 - 23| test('basic', () => { - 24| expect.soft(1).toBe(2) - 25| expect.soft(2).toBe(3) - | ^ - 26| }) - 27| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/13]⎯ - - FAIL |core| soft.test.ts > promise -AssertionError: expected 1 to be 2 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:29:3 - 27| - 28| test('promise', async () => { - 29| await expect.soft( - | ^ - 30| new Promise((resolve) => { - 31| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/13]⎯ - - FAIL |core| soft.test.ts > promise -AssertionError: expected 2 to be 3 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 3 - + 2 - - ❯ soft.test.ts:36:3 - 34| }), - 35| ).resolves.toBe(2) - 36| await expect.soft( - | ^ - 37| new Promise((resolve) => { - 38| setTimeout(() => { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/13]⎯ - - FAIL |core| soft.test.ts > with expect -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:46:18 - 44| - 45| test('with expect', () => { - 46| expect.soft(1).toEqual(2) - | ^ - 47| expect(10).toEqual(20) - 48| expect.soft(2).toEqual(3) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/13]⎯ - - FAIL |core| soft.test.ts > with expect -AssertionError: expected 10 to deeply equal 20 - - - Expected - 0 - + Received + 1 - - - 20 - + 10 - - ❯ soft.test.ts:47:14 - 45| test('with expect', () => { - 46| expect.soft(1).toEqual(2) - 47| expect(10).toEqual(20) - | ^ - 48| expect.soft(2).toEqual(3) - 49| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/13]⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 1 to deeply equal 2 - - - Expected - 0 - + Received + 1 - - - 2 - + 1 - - ❯ soft.test.ts:52:18 - 50| - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - | ^ - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/13]⎯ - - FAIL |core| soft.test.ts > with expect.extend -Error: expected 3 to be divisible by 4 - ❯ soft.test.ts:53:27 - 51| test('with expect.extend', () => { - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - | ^ - 54| expect(5).toEqual(6) - 55| }) - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/13]⎯ - - FAIL |core| soft.test.ts > with expect.extend -AssertionError: expected 5 to deeply equal 6 - - - Expected - 0 - + Received + 1 - - - 6 - + 5 - - ❯ soft.test.ts:54:13 - 52| expect.soft(1).toEqual(2); - 53| (expect.soft(3) as any).toBeDividedBy(4) - 54| expect(5).toEqual(6) - | ^ - 55| }) - 56| - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/13]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 5 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 5 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/13]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 6 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 6 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/13]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 7 to be 4 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 4 - + 7 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:73:25 - 71| num = 0 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - | ^ - 74| expect.soft(num += 1).toBe(5) - 75| }, { - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/13]⎯ - - FAIL |core| soft.test.ts > retry will failed -AssertionError: expected 8 to be 5 // Object.is equality - - - Expected - 0 - + Received + 1 - - - 5 - + 8 - - ❯ __vite_ssr_import_0__.test.retry soft.test.ts:74:25 - 72| test('retry will failed', () => { - 73| expect.soft(num += 1).toBe(4) - 74| expect.soft(num += 1).toBe(5) - | ^ - 75| }, { - 76| retry: 2, - -⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/13]⎯ - -" -`; diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index abc4bf88b159..22f6119c62c0 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -50,11 +50,4 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 4 to be 5') expect(stderr).toContain('4/4') }) - - test('snapshot', async () => { - const { stderr } = await run({ - testNamePattern: '', - }) - expect(stderr).toMatchSnapshot() - }) }) From 3cb68fae3ed2eda46f2fc53bb7aee4f3dcaa3bd6 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Sun, 4 Jun 2023 17:29:17 +0000 Subject: [PATCH 17/39] test: update timeout --- test/core/test/expect.test.ts | 2 +- test/core/test/fixtures/expects/soft.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 22f6119c62c0..169a5f4a6fca 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -16,7 +16,7 @@ describe('expect.soft', () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 2 to be 3') expect(stderr).toContain('AssertionError: expected 1 to be 2') - }) + }, 3000) test('with expect', async () => { const { stderr } = await run() diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index e910ed11435e..02c73405e127 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -40,7 +40,7 @@ test('promise', async () => { }) }), ).resolves.toBe(3) -}, 5000) +}, 3000) test('with expect', () => { expect.soft(1).toEqual(2) From 6a98eaf46fb1f7e356a46520d8d36b69fb44f753 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 02:08:37 +0000 Subject: [PATCH 18/39] test: update timeout --- test/core/test/expect.test.ts | 4 ++-- test/core/test/fixtures/expects/soft.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 169a5f4a6fca..c13a2233deef 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -16,7 +16,7 @@ describe('expect.soft', () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 2 to be 3') expect(stderr).toContain('AssertionError: expected 1 to be 2') - }, 3000) + }) test('with expect', async () => { const { stderr } = await run() @@ -50,4 +50,4 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 4 to be 5') expect(stderr).toContain('4/4') }) -}) +}, 3000) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index 02c73405e127..2ae52263cb73 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -40,7 +40,7 @@ test('promise', async () => { }) }), ).resolves.toBe(3) -}, 3000) +}) test('with expect', () => { expect.soft(1).toEqual(2) From 9ab8bc41a46c6d835e817d3ad971e88e11c7b626 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 02:22:32 +0000 Subject: [PATCH 19/39] test: fix timeout --- test/core/test/expect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index c13a2233deef..a4bafd823621 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -5,7 +5,7 @@ import { getCurrentTest } from '@vitest/runner' import { runVitest } from '../../test-utils' describe('expect.soft', () => { - const run = (config?: UserConfig) => runVitest({ root: resolve(__dirname, './fixtures/expects'), exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, ...config }, ['soft']) + const run = (config?: UserConfig) => runVitest({ root: resolve(__dirname, './fixtures/expects'), exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) test('basic', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to be 2') @@ -50,4 +50,4 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 4 to be 5') expect(stderr).toContain('4/4') }) -}, 3000) +}, 4000) From b848021076185f1cbe5e84d3c957cd4b70788c7a Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 07:22:43 +0000 Subject: [PATCH 20/39] test: remove any, add type for it --- test/core/test/fixtures/expects/soft.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/core/test/fixtures/expects/soft.test.ts index 2ae52263cb73..d7bf8c48744e 100644 --- a/test/core/test/fixtures/expects/soft.test.ts +++ b/test/core/test/fixtures/expects/soft.test.ts @@ -1,5 +1,13 @@ import { expect, test } from 'vitest' +interface CustomMatchers { + toBeDividedBy(divisor: number): R +} + +declare module 'vitest' { + interface Assertion extends CustomMatchers {} +} + expect.extend({ toBeDividedBy(received, divisor) { const pass = received % divisor === 0 @@ -49,8 +57,8 @@ test('with expect', () => { }) test('with expect.extend', () => { - expect.soft(1).toEqual(2); - (expect.soft(3) as any).toBeDividedBy(4) + expect.soft(1).toEqual(2) + expect.soft(3).toBeDividedBy(4) expect(5).toEqual(6) }) From 8ab4dcb6309a3482778ffaef8b2400bb085a075d Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 07:23:20 +0000 Subject: [PATCH 21/39] refactor: same syntax --- packages/expect/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts index f1d40f5446af..6c4406bac208 100644 --- a/packages/expect/src/types.ts +++ b/packages/expect/src/types.ts @@ -101,7 +101,7 @@ export type MatchersObject = Record(actual: T, message?: string): Assertion - soft: (actual: T, message?: string) => Assertion + soft(actual: T, message?: string): Assertion extend(expects: MatchersObject): void assertions(expected: number): void hasAssertions(): void From dccdf03ddbedbedf015b4f36642d4b750d13c2f3 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 07:40:26 +0000 Subject: [PATCH 22/39] refactor: move errros function to @vitest/utils --- packages/expect/src/utils.ts | 3 +- packages/runner/src/collect.ts | 2 +- packages/runner/src/run.ts | 31 +++++++----------- packages/runner/src/types/tasks.ts | 3 +- packages/runner/src/utils/collect.ts | 2 +- packages/runner/src/utils/index.ts | 1 - packages/utils/src/error.ts | 22 ------------- .../utils/error.ts => utils/src/errors.ts} | 32 ++++++++++++++++--- packages/utils/src/index.ts | 2 +- packages/vitest/src/node/reporters/junit.ts | 2 +- packages/vitest/src/node/reporters/tap.ts | 2 +- packages/vitest/src/runtime/execute.ts | 2 +- packages/vitest/src/types/general.ts | 2 +- test/core/test/error.test.ts | 2 +- test/core/test/replace-matcher.test.ts | 2 +- test/core/test/serialize.test.ts | 2 +- 16 files changed, 51 insertions(+), 61 deletions(-) delete mode 100644 packages/utils/src/error.ts rename packages/{runner/src/utils/error.ts => utils/src/errors.ts} (85%) diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index faf1c10910c7..e6b8fbfdc5a7 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -1,3 +1,4 @@ +import { processError } from '@vitest/utils' import { GLOBAL_EXPECT } from './constants' import { getState } from './state' import type { Assertion, MatcherState } from './types' @@ -38,7 +39,7 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic catch (err) { test.result.state = 'fail' test.result.errors ||= [] - test.result.errors.push(err) + test.result.errors.push(processError(err)) } } } diff --git a/packages/runner/src/collect.ts b/packages/runner/src/collect.ts index 656b600baeba..db0c03640666 100644 --- a/packages/runner/src/collect.ts +++ b/packages/runner/src/collect.ts @@ -1,10 +1,10 @@ import { relative } from 'pathe' +import { processError } from '@vitest/utils' import type { File } from './types' import type { VitestRunner } from './types/runner' import { calculateSuiteHash, generateHash, interpretTaskModes, someTasksAreOnly } from './utils/collect' import { clearCollectorContext, getDefaultSuite } from './suite' import { getHooks, setHooks } from './map' -import { processError } from './utils/error' import { collectorContext } from './context' import { runSetupFiles } from './setup' diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index 91dc4d3eef0b..fd46ec8c6b01 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -1,11 +1,10 @@ import limit from 'p-limit' -import { getSafeTimers, shuffle } from '@vitest/utils' +import { getSafeTimers, processError, shuffle } from '@vitest/utils' import type { VitestRunner } from './types/runner' import type { File, HookCleanupCallback, HookListener, SequenceHooks, Suite, SuiteHooks, Task, TaskMeta, TaskResult, TaskResultPack, TaskState, Test } from './types' import { partitionSuiteChildren } from './utils/suite' import { getFn, getHooks } from './map' import { collectTests } from './collect' -import { processError } from './utils/error' import { setCurrentTest } from './test-state' import { hasFailed, hasTests } from './utils/tasks' @@ -192,10 +191,7 @@ export async function runTest(test: Test, runner: VitestRunner) { // reset state when retry test test.result.state = 'run' } - else if (test.result.state === 'fail') { - // last retry failed, mark test as failed - failTask(test.result, []) - } + // update retry info updateTask(test, runner) } @@ -228,22 +224,17 @@ export async function runTest(test: Test, runner: VitestRunner) { updateTask(test, runner) } -const processedError = new WeakSet() function failTask(result: TaskResult, err: unknown) { result.state = 'fail' - const errors = Array.isArray(err) ? err : [err] - // errors maybe push in expect.soft, so we need to process them - result.errors = [...result.errors || [], ...errors].map((err) => { - let newError = err - if (!processedError.has(err)) { - newError = processError(err) - processedError.add(newError) - } - return newError - }) - const errorsLength = result.errors.length - if (errorsLength > 0) - result.error = result.errors[errorsLength - 1] + const errors = Array.isArray(err) + ? err + : [err] + for (const e of errors) { + const error = processError(e) + result.error ??= error + result.errors ??= [] + result.errors.push(error) + } } function markTasksAsSkipped(suite: Suite, runner: VitestRunner) { diff --git a/packages/runner/src/types/tasks.ts b/packages/runner/src/types/tasks.ts index 7ff9c4e4b7b1..bb1ecf4162f7 100644 --- a/packages/runner/src/types/tasks.ts +++ b/packages/runner/src/types/tasks.ts @@ -1,6 +1,5 @@ -import type { Awaitable } from '@vitest/utils' +import type { Awaitable, ErrorWithDiff } from '@vitest/utils' import type { ChainableFunction } from '../utils/chain' -import type { ErrorWithDiff } from '../utils/error' export type RunMode = 'run' | 'skip' | 'only' | 'todo' export type TaskState = RunMode | 'pass' | 'fail' diff --git a/packages/runner/src/utils/collect.ts b/packages/runner/src/utils/collect.ts index 013faa8db3ad..d4f74b4dd757 100644 --- a/packages/runner/src/utils/collect.ts +++ b/packages/runner/src/utils/collect.ts @@ -1,5 +1,5 @@ +import { processError } from '@vitest/utils' import type { Suite, TaskBase } from '../types' -import { processError } from './error' /** * If any tasks been marked as `only`, mark all other tasks as `skip`. diff --git a/packages/runner/src/utils/index.ts b/packages/runner/src/utils/index.ts index ebbe97f11de4..46b2d49e5a38 100644 --- a/packages/runner/src/utils/index.ts +++ b/packages/runner/src/utils/index.ts @@ -2,4 +2,3 @@ export * from './collect' export * from './suite' export * from './tasks' export * from './chain' -export * from './error' diff --git a/packages/utils/src/error.ts b/packages/utils/src/error.ts deleted file mode 100644 index 8189d03c7239..000000000000 --- a/packages/utils/src/error.ts +++ /dev/null @@ -1,22 +0,0 @@ -interface ErrorOptions { - message?: string - stackTraceLimit?: number -} - -/** - * Get original stacktrace without source map support the most performant way. - * - Create only 1 stack frame. - * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms). - */ -export function createSimpleStackTrace(options?: ErrorOptions) { - const { message = 'error', stackTraceLimit = 1 } = options || {} - const limit = Error.stackTraceLimit - const prepareStackTrace = Error.prepareStackTrace - Error.stackTraceLimit = stackTraceLimit - Error.prepareStackTrace = e => e.stack - const err = new Error(message) - const stackTrace = err.stack || '' - Error.prepareStackTrace = prepareStackTrace - Error.stackTraceLimit = limit - return stackTrace -} diff --git a/packages/runner/src/utils/error.ts b/packages/utils/src/errors.ts similarity index 85% rename from packages/runner/src/utils/error.ts rename to packages/utils/src/errors.ts index 45891976f8dc..b22ef1177488 100644 --- a/packages/runner/src/utils/error.ts +++ b/packages/utils/src/errors.ts @@ -1,8 +1,30 @@ -import { deepClone, format, getOwnProperties, getType, stringify } from '@vitest/utils' -import type { DiffOptions } from '@vitest/utils/diff' -import { unifiedDiff } from '@vitest/utils/diff' - -export type { ParsedStack, ErrorWithDiff } from '@vitest/utils' +import type { DiffOptions } from './diff' +import { unifiedDiff } from './diff' +import { format } from './display' +import { deepClone, getOwnProperties, getType } from './helpers' +import { stringify } from './stringify' + +interface ErrorOptions { + message?: string + stackTraceLimit?: number +} +/** + * Get original stacktrace without source map support the most performant way. + * - Create only 1 stack frame. + * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms). + */ +export function createSimpleStackTrace(options?: ErrorOptions) { + const { message = 'error', stackTraceLimit = 1 } = options || {} + const limit = Error.stackTraceLimit + const prepareStackTrace = Error.prepareStackTrace + Error.stackTraceLimit = stackTraceLimit + Error.prepareStackTrace = e => e.stack + const err = new Error(message) + const stackTrace = err.stack || '' + Error.prepareStackTrace = prepareStackTrace + Error.stackTraceLimit = limit + return stackTrace +} const IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@' const IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@' diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index f52bac3f9414..5a719c5de8d5 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -6,5 +6,5 @@ export * from './random' export * from './display' export * from './constants' export * from './colors' -export * from './error' +export * from './errors' export * from './source-map' diff --git a/packages/vitest/src/node/reporters/junit.ts b/packages/vitest/src/node/reporters/junit.ts index 9437bb83331d..e4d0ac979b85 100644 --- a/packages/vitest/src/node/reporters/junit.ts +++ b/packages/vitest/src/node/reporters/junit.ts @@ -3,7 +3,7 @@ import { hostname } from 'node:os' import { dirname, relative, resolve } from 'pathe' import type { Task } from '@vitest/runner' -import type { ErrorWithDiff } from '@vitest/runner/utils' +import type { ErrorWithDiff } from '@vitest/utils' import type { Vitest } from '../../node' import type { Reporter } from '../../types/reporter' import { parseErrorStacktrace } from '../../utils/source-map' diff --git a/packages/vitest/src/node/reporters/tap.ts b/packages/vitest/src/node/reporters/tap.ts index 31de7864072d..d37538c3e271 100644 --- a/packages/vitest/src/node/reporters/tap.ts +++ b/packages/vitest/src/node/reporters/tap.ts @@ -1,5 +1,5 @@ import type { Task } from '@vitest/runner' -import type { ParsedStack } from '@vitest/runner/utils' +import type { ParsedStack } from '@vitest/utils' import type { Vitest } from '../../node' import type { Reporter } from '../../types/reporter' import { parseErrorStacktrace } from '../../utils/source-map' diff --git a/packages/vitest/src/runtime/execute.ts b/packages/vitest/src/runtime/execute.ts index bacd3c3b1747..444eb87d9f8c 100644 --- a/packages/vitest/src/runtime/execute.ts +++ b/packages/vitest/src/runtime/execute.ts @@ -3,7 +3,7 @@ import { ModuleCacheMap, ViteNodeRunner } from 'vite-node/client' import { isInternalRequest, isNodeBuiltin, isPrimitive } from 'vite-node/utils' import type { ViteNodeRunnerOptions } from 'vite-node' import { normalize, relative, resolve } from 'pathe' -import { processError } from '@vitest/runner/utils' +import { processError } from '@vitest/utils' import type { MockMap } from '../types/mocker' import { getCurrentEnvironment, getWorkerState } from '../utils/global' import type { ContextRPC, ContextTestEnvironment, ResolvedConfig } from '../types' diff --git a/packages/vitest/src/types/general.ts b/packages/vitest/src/types/general.ts index e71d3c3ee3a5..1af33776a435 100644 --- a/packages/vitest/src/types/general.ts +++ b/packages/vitest/src/types/general.ts @@ -1,4 +1,4 @@ -export type { ErrorWithDiff, ParsedStack } from '@vitest/runner/utils' +export type { ErrorWithDiff, ParsedStack } from '@vitest/utils' export type Awaitable = T | PromiseLike export type Nullable = T | null | undefined diff --git a/test/core/test/error.test.ts b/test/core/test/error.test.ts index eb186ea60a8c..2f72d2d8fbb3 100644 --- a/test/core/test/error.test.ts +++ b/test/core/test/error.test.ts @@ -1,4 +1,4 @@ -import { processError } from '@vitest/runner/utils' +import { processError } from '@vitest/utils' import { expect, test } from 'vitest' test('Can correctly process error where actual and expected contains non writable properties', () => { diff --git a/test/core/test/replace-matcher.test.ts b/test/core/test/replace-matcher.test.ts index d6e21c4f6c52..6859c053a72f 100644 --- a/test/core/test/replace-matcher.test.ts +++ b/test/core/test/replace-matcher.test.ts @@ -1,5 +1,5 @@ +import { replaceAsymmetricMatcher } from '@vitest/utils' import { describe, expect, it } from 'vitest' -import { replaceAsymmetricMatcher } from '@vitest/runner/utils' describe('replace asymmetric matcher', () => { const expectReplaceAsymmetricMatcher = (actual: any, expected: any) => { diff --git a/test/core/test/serialize.test.ts b/test/core/test/serialize.test.ts index c54b5af84f19..76824e0a6355 100644 --- a/test/core/test/serialize.test.ts +++ b/test/core/test/serialize.test.ts @@ -1,7 +1,7 @@ // @vitest-environment jsdom +import { serializeError } from '@vitest/utils' import { describe, expect, it } from 'vitest' -import { serializeError } from '@vitest/runner/utils' describe('error serialize', () => { it('works', () => { From 79057a4e95cf9138d1b3d01d5945f88e6539bd1b Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 07:50:40 +0000 Subject: [PATCH 23/39] test: add types --- test/core/test/expect.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index a4bafd823621..ac88f0f2879c 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' import type { UserConfig } from 'vitest' -import { describe, expect, test } from 'vitest' +import { describe, expect, expectTypeOf, test } from 'vitest' import { getCurrentTest } from '@vitest/runner' import { runVitest } from '../../test-utils' @@ -50,4 +50,11 @@ describe('expect.soft', () => { expect(stderr).toContain('AssertionError: expected 4 to be 5') expect(stderr).toContain('4/4') }) + + test('types', () => { + expectTypeOf(expect).toEqualTypeOf(expect) + expectTypeOf(expect.soft(7)).toEqualTypeOf(expect(7)) + expectTypeOf(expect.soft(5)).toHaveProperty('toBe') + expectTypeOf(expect.soft(7)).not.toHaveProperty('toCustom') + }) }, 4000) From 64e74dd5468b12476d1ac71b3cd5e68afec97002 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 07:56:42 +0000 Subject: [PATCH 24/39] test: using expect.soft for test --- test/core/test/expect.test.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index ac88f0f2879c..8544a77bc3c9 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -6,6 +6,14 @@ import { runVitest } from '../../test-utils' describe('expect.soft', () => { const run = (config?: UserConfig) => runVitest({ root: resolve(__dirname, './fixtures/expects'), exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) + + test('types', () => { + expectTypeOf(expect).toEqualTypeOf(expect) + expectTypeOf(expect.soft(7)).toEqualTypeOf(expect(7)) + expectTypeOf(expect.soft(5)).toHaveProperty('toBe') + expectTypeOf(expect.soft(7)).not.toHaveProperty('toCustom') + }) + test('basic', async () => { const { stderr } = await run() expect(stderr).toContain('AssertionError: expected 1 to be 2') @@ -51,10 +59,14 @@ describe('expect.soft', () => { expect(stderr).toContain('4/4') }) - test('types', () => { - expectTypeOf(expect).toEqualTypeOf(expect) - expectTypeOf(expect.soft(7)).toEqualTypeOf(expect(7)) - expectTypeOf(expect.soft(5)).toHaveProperty('toBe') - expectTypeOf(expect.soft(7)).not.toHaveProperty('toCustom') + test('using expect.soft for test', async () => { + const { stderr } = await run({ + testNamePattern: 'retry will failed', + }) + expect.soft(stderr).toContain('AssertionError: expected 1 to be 4') + expect.soft(stderr).toContain('AssertionError: expected 2 to be 5') + expect.soft(stderr).toContain('AssertionError: expected 3 to be 4') + expect.soft(stderr).toContain('AssertionError: expected 4 to be 5') + expect.soft(stderr).toContain('4/4') }) }, 4000) From 9c0cedddd93f33cf2f2c8fe157c2004b2765017f Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 08:28:40 +0000 Subject: [PATCH 25/39] chore: missing json plugin --- packages/snapshot/rollup.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/snapshot/rollup.config.js b/packages/snapshot/rollup.config.js index c74d3fefee68..101f7b44b5ff 100644 --- a/packages/snapshot/rollup.config.js +++ b/packages/snapshot/rollup.config.js @@ -3,6 +3,7 @@ import esbuild from 'rollup-plugin-esbuild' import nodeResolve from '@rollup/plugin-node-resolve' import dts from 'rollup-plugin-dts' import commonjs from '@rollup/plugin-commonjs' +import json from '@rollup/plugin-json' import { defineConfig } from 'rollup' import pkg from './package.json' assert { type: 'json' } @@ -23,6 +24,7 @@ const plugins = [ preferBuiltins: true, }), commonjs(), + json(), esbuild({ target: 'node14', }), From aebb44c862c2e191daad6e91b624f38ede0d6ccd Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 09:17:13 +0000 Subject: [PATCH 26/39] feat: add entry --- packages/expect/rollup.config.js | 1 + packages/expect/src/utils.ts | 2 +- packages/runner/rollup.config.js | 2 +- packages/runner/src/collect.ts | 2 +- packages/runner/src/run.ts | 3 ++- packages/runner/src/utils/collect.ts | 2 +- packages/snapshot/rollup.config.js | 2 -- packages/utils/error.d.ts | 1 + packages/utils/package.json | 4 ++++ packages/utils/rollup.config.js | 1 + packages/utils/src/base.ts | 21 +++++++++++++++++++++ packages/utils/src/{errors.ts => error.ts} | 22 ---------------------- packages/utils/src/index.ts | 2 +- packages/vitest/rollup.config.js | 1 + packages/vitest/src/runtime/execute.ts | 2 +- test/core/test/error.test.ts | 2 +- test/core/test/replace-matcher.test.ts | 2 +- test/core/test/serialize.test.ts | 2 +- 18 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 packages/utils/error.d.ts create mode 100644 packages/utils/src/base.ts rename packages/utils/src/{errors.ts => error.ts} (88%) diff --git a/packages/expect/rollup.config.js b/packages/expect/rollup.config.js index 93f60d59c401..6ba38766cce2 100644 --- a/packages/expect/rollup.config.js +++ b/packages/expect/rollup.config.js @@ -9,6 +9,7 @@ const external = [ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {}), '@vitest/utils/diff', + '@vitest/utils/error', ] const plugins = [ diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index e6b8fbfdc5a7..b4374fcf7e80 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -1,4 +1,4 @@ -import { processError } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import { GLOBAL_EXPECT } from './constants' import { getState } from './state' import type { Assertion, MatcherState } from './types' diff --git a/packages/runner/rollup.config.js b/packages/runner/rollup.config.js index 1d1f02aca174..cebc5be6478a 100644 --- a/packages/runner/rollup.config.js +++ b/packages/runner/rollup.config.js @@ -9,7 +9,7 @@ const external = [ ...builtinModules, ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {}), - '@vitest/utils/diff', + '@vitest/utils/error', ] const entries = { diff --git a/packages/runner/src/collect.ts b/packages/runner/src/collect.ts index db0c03640666..807ca6fab0c4 100644 --- a/packages/runner/src/collect.ts +++ b/packages/runner/src/collect.ts @@ -1,5 +1,5 @@ import { relative } from 'pathe' -import { processError } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import type { File } from './types' import type { VitestRunner } from './types/runner' import { calculateSuiteHash, generateHash, interpretTaskModes, someTasksAreOnly } from './utils/collect' diff --git a/packages/runner/src/run.ts b/packages/runner/src/run.ts index fd46ec8c6b01..1788675632e6 100644 --- a/packages/runner/src/run.ts +++ b/packages/runner/src/run.ts @@ -1,5 +1,6 @@ import limit from 'p-limit' -import { getSafeTimers, processError, shuffle } from '@vitest/utils' +import { getSafeTimers, shuffle } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import type { VitestRunner } from './types/runner' import type { File, HookCleanupCallback, HookListener, SequenceHooks, Suite, SuiteHooks, Task, TaskMeta, TaskResult, TaskResultPack, TaskState, Test } from './types' import { partitionSuiteChildren } from './utils/suite' diff --git a/packages/runner/src/utils/collect.ts b/packages/runner/src/utils/collect.ts index d4f74b4dd757..b163bae7f716 100644 --- a/packages/runner/src/utils/collect.ts +++ b/packages/runner/src/utils/collect.ts @@ -1,4 +1,4 @@ -import { processError } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import type { Suite, TaskBase } from '../types' /** diff --git a/packages/snapshot/rollup.config.js b/packages/snapshot/rollup.config.js index 101f7b44b5ff..c74d3fefee68 100644 --- a/packages/snapshot/rollup.config.js +++ b/packages/snapshot/rollup.config.js @@ -3,7 +3,6 @@ import esbuild from 'rollup-plugin-esbuild' import nodeResolve from '@rollup/plugin-node-resolve' import dts from 'rollup-plugin-dts' import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' import { defineConfig } from 'rollup' import pkg from './package.json' assert { type: 'json' } @@ -24,7 +23,6 @@ const plugins = [ preferBuiltins: true, }), commonjs(), - json(), esbuild({ target: 'node14', }), diff --git a/packages/utils/error.d.ts b/packages/utils/error.d.ts new file mode 100644 index 000000000000..9329baa87d94 --- /dev/null +++ b/packages/utils/error.d.ts @@ -0,0 +1 @@ +export * from './dist/error.js' diff --git a/packages/utils/package.json b/packages/utils/package.json index 292ed2706ef8..3da3d7cda077 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,6 +24,10 @@ "types": "./dist/diff.d.ts", "import": "./dist/diff.js" }, + "./error": { + "types": "./dist/error.d.ts", + "import": "./dist/error.js" + }, "./helpers": { "types": "./dist/helpers.d.ts", "import": "./dist/helpers.js" diff --git a/packages/utils/rollup.config.js b/packages/utils/rollup.config.js index 2a315c966703..721ece68bdb9 100644 --- a/packages/utils/rollup.config.js +++ b/packages/utils/rollup.config.js @@ -10,6 +10,7 @@ const entries = { index: 'src/index.ts', helpers: 'src/helpers.ts', diff: 'src/diff.ts', + error: 'src/error.ts', types: 'src/types.ts', } diff --git a/packages/utils/src/base.ts b/packages/utils/src/base.ts new file mode 100644 index 000000000000..27ab8298929d --- /dev/null +++ b/packages/utils/src/base.ts @@ -0,0 +1,21 @@ +interface ErrorOptions { + message?: string + stackTraceLimit?: number +} +/** + * Get original stacktrace without source map support the most performant way. + * - Create only 1 stack frame. + * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms). + */ +export function createSimpleStackTrace(options?: ErrorOptions) { + const { message = 'error', stackTraceLimit = 1 } = options || {} + const limit = Error.stackTraceLimit + const prepareStackTrace = Error.prepareStackTrace + Error.stackTraceLimit = stackTraceLimit + Error.prepareStackTrace = e => e.stack + const err = new Error(message) + const stackTrace = err.stack || '' + Error.prepareStackTrace = prepareStackTrace + Error.stackTraceLimit = limit + return stackTrace +} diff --git a/packages/utils/src/errors.ts b/packages/utils/src/error.ts similarity index 88% rename from packages/utils/src/errors.ts rename to packages/utils/src/error.ts index b22ef1177488..a610477688ec 100644 --- a/packages/utils/src/errors.ts +++ b/packages/utils/src/error.ts @@ -4,28 +4,6 @@ import { format } from './display' import { deepClone, getOwnProperties, getType } from './helpers' import { stringify } from './stringify' -interface ErrorOptions { - message?: string - stackTraceLimit?: number -} -/** - * Get original stacktrace without source map support the most performant way. - * - Create only 1 stack frame. - * - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms). - */ -export function createSimpleStackTrace(options?: ErrorOptions) { - const { message = 'error', stackTraceLimit = 1 } = options || {} - const limit = Error.stackTraceLimit - const prepareStackTrace = Error.prepareStackTrace - Error.stackTraceLimit = stackTraceLimit - Error.prepareStackTrace = e => e.stack - const err = new Error(message) - const stackTrace = err.stack || '' - Error.prepareStackTrace = prepareStackTrace - Error.stackTraceLimit = limit - return stackTrace -} - const IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@' const IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@' diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 5a719c5de8d5..cfe390aebc70 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -6,5 +6,5 @@ export * from './random' export * from './display' export * from './constants' export * from './colors' -export * from './errors' +export * from './base' export * from './source-map' diff --git a/packages/vitest/rollup.config.js b/packages/vitest/rollup.config.js index 4b7f1451c87c..63d3cb65766b 100644 --- a/packages/vitest/rollup.config.js +++ b/packages/vitest/rollup.config.js @@ -61,6 +61,7 @@ const external = [ 'vite-node/server', 'vite-node/utils', '@vitest/utils/diff', + '@vitest/utils/error', '@vitest/runner/utils', '@vitest/runner/types', '@vitest/snapshot/environment', diff --git a/packages/vitest/src/runtime/execute.ts b/packages/vitest/src/runtime/execute.ts index 444eb87d9f8c..3cc62ad2aa79 100644 --- a/packages/vitest/src/runtime/execute.ts +++ b/packages/vitest/src/runtime/execute.ts @@ -3,7 +3,7 @@ import { ModuleCacheMap, ViteNodeRunner } from 'vite-node/client' import { isInternalRequest, isNodeBuiltin, isPrimitive } from 'vite-node/utils' import type { ViteNodeRunnerOptions } from 'vite-node' import { normalize, relative, resolve } from 'pathe' -import { processError } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import type { MockMap } from '../types/mocker' import { getCurrentEnvironment, getWorkerState } from '../utils/global' import type { ContextRPC, ContextTestEnvironment, ResolvedConfig } from '../types' diff --git a/test/core/test/error.test.ts b/test/core/test/error.test.ts index 2f72d2d8fbb3..02c39af569d2 100644 --- a/test/core/test/error.test.ts +++ b/test/core/test/error.test.ts @@ -1,4 +1,4 @@ -import { processError } from '@vitest/utils' +import { processError } from '@vitest/utils/error' import { expect, test } from 'vitest' test('Can correctly process error where actual and expected contains non writable properties', () => { diff --git a/test/core/test/replace-matcher.test.ts b/test/core/test/replace-matcher.test.ts index 6859c053a72f..3c77007650b0 100644 --- a/test/core/test/replace-matcher.test.ts +++ b/test/core/test/replace-matcher.test.ts @@ -1,4 +1,4 @@ -import { replaceAsymmetricMatcher } from '@vitest/utils' +import { replaceAsymmetricMatcher } from '@vitest/utils/error' import { describe, expect, it } from 'vitest' describe('replace asymmetric matcher', () => { diff --git a/test/core/test/serialize.test.ts b/test/core/test/serialize.test.ts index 76824e0a6355..2b29aa728b4f 100644 --- a/test/core/test/serialize.test.ts +++ b/test/core/test/serialize.test.ts @@ -1,6 +1,6 @@ // @vitest-environment jsdom -import { serializeError } from '@vitest/utils' +import { serializeError } from '@vitest/utils/error' import { describe, expect, it } from 'vitest' describe('error serialize', () => { From 093917b145cd509f12665afb6aafbffcec7675ee Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 09:21:33 +0000 Subject: [PATCH 27/39] test: fix ci From beaea428eb941c0b938ecc78ae3f5095ec6bdd05 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 14:59:53 +0000 Subject: [PATCH 28/39] test: should better --- pnpm-lock.yaml | 332 +++++++++++------- test/core/test/expect.test.ts | 83 ++--- .../fixtures/expects/soft.test.ts | 0 test/failing/fixtures/vite.config.ts | 8 + test/failing/package.json | 14 + test/failing/test/expect.test.ts | 54 +++ test/failing/vite.config.ts | 10 + 7 files changed, 309 insertions(+), 192 deletions(-) rename test/{core/test => failing}/fixtures/expects/soft.test.ts (100%) create mode 100644 test/failing/fixtures/vite.config.ts create mode 100644 test/failing/package.json create mode 100644 test/failing/test/expect.test.ts create mode 100644 test/failing/vite.config.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a65e911d3eaa..4033cd034a70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,7 +325,7 @@ importers: version: 20.2.5 '@types/react': specifier: latest - version: 18.2.7 + version: 18.2.8 '@vitejs/plugin-react': specifier: latest version: 4.0.0(vite@4.3.9) @@ -392,7 +392,7 @@ importers: version: link:../../packages/ui happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 jsdom: specifier: latest version: 22.1.0 @@ -731,10 +731,10 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.0 - version: 2.0.0(svelte@3.58.0)(vite@4.3.9) + version: 2.0.0(svelte@3.59.1)(vite@4.3.9) '@testing-library/svelte': specifier: ^3.2.2 - version: 3.2.2(svelte@3.58.0) + version: 3.2.2(svelte@3.59.1) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -743,7 +743,7 @@ importers: version: 22.1.0 svelte: specifier: latest - version: 3.58.0 + version: 3.59.1 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -768,10 +768,10 @@ importers: version: 22.1.0 unplugin-auto-import: specifier: latest - version: 0.12.1(rollup@3.20.2) + version: 0.16.4(rollup@3.20.2) unplugin-vue-components: specifier: latest - version: 0.22.12(rollup@3.20.2)(vue@3.3.4) + version: 0.25.0(rollup@3.20.2)(vue@3.3.4) vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -1416,7 +1416,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/base: devDependencies: @@ -1530,7 +1530,7 @@ importers: version: 2.3.2(vue@3.3.4) happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 istanbul-lib-coverage: specifier: ^3.2.0 version: 3.2.0 @@ -1545,7 +1545,7 @@ importers: version: 3.3.4 webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/css: devDependencies: @@ -1596,6 +1596,21 @@ importers: specifier: workspace:* version: link:../../packages/vitest + test/failing: + devDependencies: + '@vitest/coverage-istanbul': + specifier: workspace:* + version: link:../../packages/coverage-istanbul + '@vitest/runner': + specifier: workspace:* + version: link:../../packages/runner + jsdom: + specifier: ^21.0.0 + version: 21.1.2 + vitest: + specifier: workspace:* + version: link:../../packages/vitest + test/fails: devDependencies: '@vitest/coverage-istanbul': @@ -1810,7 +1825,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/web-worker: devDependencies: @@ -2083,6 +2098,10 @@ packages: resolution: {integrity: sha512-vy9fM3pIxZmX07dL+VX1aZe7ynZ+YyB0jY+jE6r3hOK6GNY2t6W8rzpFC4tgpbXUYABkFQwgJq2XYXlxbXAI0g==} dev: true + /@antfu/utils@0.7.4: + resolution: {integrity: sha512-qe8Nmh9rYI/HIspLSTwtbMFPj6dISG6+dJnOguTlPNXtCvS2uezdxscVBb7/3DrmNbQK49TDqpkSQ1chbRGdpQ==} + dev: true + /@apideck/better-ajv-errors@0.3.6(ajv@8.11.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2159,7 +2178,7 @@ packages: gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 source-map: 0.5.7 transitivePeerDependencies: @@ -2409,7 +2428,7 @@ packages: '@babel/traverse': 7.21.4 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2425,7 +2444,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2441,7 +2460,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -6340,8 +6359,8 @@ packages: - supports-color dev: true - /@puppeteer/browsers@1.0.1(typescript@5.0.4): - resolution: {integrity: sha512-9wkYhON9zBgtjYRE3FcokGCfjG25zjzNAYmsHpiWitRZ/4DeT3v125/fCUU66SaPJ4nUsxGNPgpS1TOcQ+8StA==} + /@puppeteer/browsers@1.3.0(typescript@5.0.4): + resolution: {integrity: sha512-an3QdbNPkuU6qpxpbssxAbjRLJcF+eP4L8UqIY3+6n0sbaVxw5pz7PiCLy9g32XEZuoamUlV5ZQPnA6FxvkIHA==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -6448,7 +6467,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 2.79.1 dev: true @@ -7957,7 +7976,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.58.0)(vite@4.3.9): + /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.59.1)(vite@4.3.9): resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -7968,8 +7987,8 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.27.0 - svelte: 3.58.0 - svelte-hmr: 0.15.1(svelte@3.58.0) + svelte: 3.59.1 + svelte-hmr: 0.15.1(svelte@3.59.1) vite: 4.3.9(@types/node@18.16.3) vitefu: 0.2.3(vite@4.3.9) transitivePeerDependencies: @@ -8093,14 +8112,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/svelte@3.2.2(svelte@3.58.0): + /@testing-library/svelte@3.2.2(svelte@3.59.1): resolution: {integrity: sha512-IKwZgqbekC3LpoRhSwhd0JswRGxKdAGkf39UiDXTywK61YyLXbCYoR831e/UUC6EeNW4hiHPY+2WuovxOgI5sw==} engines: {node: '>= 10'} peerDependencies: svelte: 3.x dependencies: '@testing-library/dom': 8.17.1 - svelte: 3.58.0 + svelte: 3.59.1 dev: true /@testing-library/user-event@13.5.0(@testing-library/dom@8.17.1): @@ -8247,7 +8266,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/eslint-scope@3.7.4: @@ -8489,19 +8508,19 @@ packages: /@types/react-dom@18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-dom@18.0.8: resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-is@17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react-test-renderer@17.0.2: @@ -8513,7 +8532,7 @@ packages: /@types/react-transition-group@4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react@17.0.49: @@ -8532,8 +8551,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react@18.2.7: - resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} + /@types/react@18.2.8: + resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9654,13 +9673,13 @@ packages: vue-demi: 0.14.0(vue@3.2.39) dev: false - /@wdio/config@8.10.2: - resolution: {integrity: sha512-CBPyxay3vVlAnwF+Dv2zsM4QMOVg8rOiD1HAdm9BilwbID2RnLF5i0IYNIFsAblhSZQhXkn5BXAcFSEIVHwOgA==} + /@wdio/config@8.10.7: + resolution: {integrity: sha512-m7JX9X/RPM+4KZQkSUhPHXeS3PJJky0UB62ZLh28TYCzVxEKNq1gFb6Cvqfn+w6Ym/UCFBaZzDrRLLXUAgUifw==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 decamelize: 6.0.0 deepmerge-ts: 5.0.0 glob: 10.2.2 @@ -9682,6 +9701,16 @@ packages: read-pkg-up: 9.1.0 dev: true + /@wdio/logger@8.10.6: + resolution: {integrity: sha512-pJYKecNYS0vu0FxDaii6MYQlYkORDLGdRWi70hrihH20sMZofzMA1tvzRMRk1VTrsUUE4TLJXKdmT2JRMN+OPw==} + engines: {node: ^16.13 || >=18} + dependencies: + chalk: 5.2.0 + loglevel: 1.8.1 + loglevel-plugin-prefix: 0.8.4 + strip-ansi: 7.1.0 + dev: true + /@wdio/logger@8.6.6: resolution: {integrity: sha512-MS+Y5yqFGx2zVXMOfuBQAVdFsP4DuYz+/hM552xwiDWjGg6EZHoccqUYgH3J5zpu3JFpYV3R/a5jExFiGGck6g==} engines: {node: ^16.13 || >=18} @@ -9714,8 +9743,8 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/types@8.10.2: - resolution: {integrity: sha512-d0oWX82CVE4Z7ipD2GpPhaeFKh7JDaDNzgiQpPYkS74TBSqQV+yrqvqRlrmHD4nmRgFwnjtD8AFOo7ackeURhg==} + /@wdio/types@8.10.4: + resolution: {integrity: sha512-aLJ1QQW+hhALeRK3bvMLjIrlUVyhOs3Od+91pR4Z4pLwyeNG1bJZCJRD5bAJK/mm7CnFa0NsdixPS9jJxZcRrw==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 @@ -9728,12 +9757,12 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/utils@8.10.2: - resolution: {integrity: sha512-lMIqztb4Mmi2arsM089SDfubx9v0/a/7Ul+vMOt7P19ZEogiWnbELmIs/CaVOxjEcgaNjXM2s56ORKnAObJfgg==} + /@wdio/utils@8.10.7: + resolution: {integrity: sha512-G9r/bQl4J25WPKeW0e+27gqNvG+x7MyZEOICl6SwyBe0SqO7JBFOBARx4oUEp2zQYmnCRNtCrHa7yM/O4OPuKA==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 import-meta-resolve: 3.0.0 p-iteration: 1.1.8 dev: true @@ -11716,8 +11745,8 @@ packages: mitt: 3.0.0 dev: true - /chromium-bidi@0.4.7(devtools-protocol@0.0.1120988): - resolution: {integrity: sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==} + /chromium-bidi@0.4.9(devtools-protocol@0.0.1120988): + resolution: {integrity: sha512-u3DC6XwgLCA9QJ5ak1voPslCmacQdulZNCPsI3qNXxSnEcZS7DFIbww+5RM2bznMEje7cc0oydavRLRvOIZtHw==} peerDependencies: devtools-protocol: '*' dependencies: @@ -12252,6 +12281,14 @@ packages: transitivePeerDependencies: - encoding + /cross-fetch@3.1.6: + resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} + dependencies: + node-fetch: 2.6.11 + transitivePeerDependencies: + - encoding + dev: true + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -12924,28 +12961,28 @@ packages: resolution: {integrity: sha512-LF+0k1kYkrx2dZsvjLyNY2ySydz4lCy/xFvjuI5mCFGnepk5hC9iXbsdFk6jYma0ZvXaTxl3sGTiVr/GC0knyQ==} dev: true - /devtools-protocol@0.0.1138159: - resolution: {integrity: sha512-IVXe1ZEQJWkMkeg10hRoZu3luP054z8USOpBIyorCTTABKVg0gBGt4rmwjGmThMEKaTb4nEmjVJkZ3/YxU0whA==} + /devtools-protocol@0.0.1149535: + resolution: {integrity: sha512-vpM8tGaYz2nrN9n8rvUEhQCgU05ocejO5WIJySsftEHxUahQ/fWuNyPxXuQNBEmaISYyMZkxCunhjtSEyBl/Dg==} dev: true /devtools-protocol@0.0.981744: resolution: {integrity: sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==} dev: true - /devtools@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-pvnTf0GtY1ILgBBxjGpQmwmiIklPQFQNirW4deluoLnhKLt6ekdKjYRLoK7goNN0rYPx7R/KK6Aqe5mgWKxBaA==} + /devtools@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-picJDxsjpaOW7gnQjcQVGDXvxuP1RZ4VNJpvJ+qiy86Gf3l4FGLKYkpJJFAMsIugL0XPs89bIVhjbtIv5NGL1w==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 chrome-launcher: 0.15.1 edge-paths: 3.0.5 import-meta-resolve: 3.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 ua-parser-js: 1.0.34 uuid: 9.0.0 @@ -13935,7 +13972,7 @@ packages: dependencies: debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.11.0 - resolve: 1.22.1 + resolve: 1.22.2 transitivePeerDependencies: - supports-color dev: true @@ -15584,6 +15621,23 @@ packages: responselike: 3.0.0 dev: true + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 5.3.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.8 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.0 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + dev: true + /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -15630,8 +15684,8 @@ packages: uglify-js: 3.17.0 dev: true - /happy-dom@9.1.9: - resolution: {integrity: sha512-OMbnoknA7iNNG/5fwt1JckCKc53QLLFo2ljzit1pCV9SC1TYwcQj0obq0QUTeqIf2p2skbFG69bo19YoSj/1DA==} + /happy-dom@9.10.7: + resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -15641,11 +15695,11 @@ packages: whatwg-mimetype: 3.0.0 dev: true - /happy-dom@9.10.7: - resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} + /happy-dom@9.20.3: + resolution: {integrity: sha512-eBsgauT435fXFvQDNcmm5QbGtYzxEzOaX35Ia+h6yP/wwa4xSWZh1CfP+mGby8Hk6Xu59mTkpyf72rUXHNxY7A==} dependencies: css.escape: 1.5.1 - he: 1.2.0 + entities: 4.5.0 iconv-lite: 0.6.3 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 @@ -17225,7 +17279,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) jest-util: 27.5.1 jest-validate: 27.5.1 - resolve: 1.22.1 + resolve: 1.22.2 resolve.exports: 1.1.1 slash: 3.0.0 dev: true @@ -18693,6 +18747,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.1: + resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true @@ -19175,7 +19236,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -20509,8 +20570,8 @@ packages: - utf-8-validate dev: true - /puppeteer-core@20.1.1(typescript@5.0.4): - resolution: {integrity: sha512-iB9F2Om8J+nU4qi30oYw0hMWOw6eQN7kFkLLI/u3UvxONOCx5o0KmM6+byaK2/QGIuQu2ly1mPaJnC1DyoW07Q==} + /puppeteer-core@20.3.0(typescript@5.0.4): + resolution: {integrity: sha512-264pBrIui5bO6NJeOcbJrLa0OCwmA4+WK00JMrLIKTfRiqe2gx8KWTzLsjyw/bizErp3TKS7vt/I0i5fTC+mAw==} engines: {node: '>=16.0.0'} peerDependencies: typescript: '>= 4.7.4' @@ -20518,17 +20579,12 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.0.1(typescript@5.0.4) - chromium-bidi: 0.4.7(devtools-protocol@0.0.1120988) - cross-fetch: 3.1.5 + '@puppeteer/browsers': 1.3.0(typescript@5.0.4) + chromium-bidi: 0.4.9(devtools-protocol@0.0.1120988) + cross-fetch: 3.1.6 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1120988 - extract-zip: 2.0.1(supports-color@8.1.1) - https-proxy-agent: 5.0.1 - proxy-from-env: 1.1.0 - tar-fs: 2.1.1 typescript: 5.0.4 - unbzip2-stream: 1.4.3 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -20725,7 +20781,7 @@ packages: estree-to-babel: 3.2.1 neo-async: 2.6.2 node-dir: 0.1.17 - resolve: 1.22.1 + resolve: 1.22.2 strip-indent: 3.0.0 transitivePeerDependencies: - supports-color @@ -21366,6 +21422,15 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} @@ -22445,6 +22510,13 @@ packages: ansi-regex: 6.0.1 dev: true + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} engines: {node: '>=0.10.0'} @@ -22624,17 +22696,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr@0.15.1(svelte@3.58.0): + /svelte-hmr@0.15.1(svelte@3.59.1): resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.58.0 + svelte: 3.59.1 dev: true - /svelte@3.58.0: - resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} + /svelte@3.59.1: + resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} engines: {node: '>= 8'} dev: true @@ -23417,24 +23489,6 @@ packages: vfile: 4.2.1 dev: true - /unimport@1.3.0(rollup@3.20.2): - resolution: {integrity: sha512-fOkrdxglsHd428yegH0wPH/6IfaSdDeMXtdRGn6en/ccyzc2aaoxiUTMrJyc6Bu+xoa18RJRPMfLUHEzjz8atw==} - dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - escape-string-regexp: 5.0.0 - fast-glob: 3.2.12 - local-pkg: 0.4.3 - magic-string: 0.27.0 - mlly: 1.3.0 - pathe: 1.1.0 - pkg-types: 1.0.3 - scule: 1.0.0 - strip-literal: 1.0.1 - unplugin: 1.3.1 - transitivePeerDependencies: - - rollup - dev: true - /unimport@3.0.6(rollup@3.20.2): resolution: {integrity: sha512-GYxGJ1Bri1oqx8VFDjdgooGzeK7jBk3bvhXmamTIpu3nONOcUMGwZbX7X0L5RA7OWMXpR4vzpSQP7pXUzJg1/Q==} dependencies: @@ -23643,27 +23697,32 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import@0.12.1(rollup@3.20.2): - resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} + /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): + resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} engines: {node: '>=14'} peerDependencies: + '@nuxt/kit': ^3.2.2 '@vueuse/core': '*' peerDependenciesMeta: + '@nuxt/kit': + optional: true '@vueuse/core': optional: true dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 - magic-string: 0.27.0 - unimport: 1.3.0(rollup@3.20.2) + magic-string: 0.30.0 + minimatch: 9.0.0 + unimport: 3.0.6(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): - resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} + /unplugin-auto-import@0.16.4(rollup@3.20.2): + resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -23674,38 +23733,39 @@ packages: '@vueuse/core': optional: true dependencies: - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.0 - unimport: 3.0.6(rollup@3.20.2) + minimatch: 9.0.1 + unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-vue-components@0.22.12(rollup@3.20.2)(vue@3.3.4): - resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} + /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 + '@nuxt/kit': ^3.2.2 vue: 2 || 3 peerDependenciesMeta: '@babel/parser': optional: true + '@nuxt/kit': + optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.2(rollup@2.79.1) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 - magic-string: 0.27.0 - minimatch: 5.1.1 + magic-string: 0.30.0 + minimatch: 7.4.2 resolve: 1.22.1 - unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 vue: 3.3.4 transitivePeerDependencies: @@ -23713,7 +23773,7 @@ packages: - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: @@ -23727,7 +23787,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@2.79.1) + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 @@ -23736,14 +23796,14 @@ packages: minimatch: 7.4.2 resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.3.4 + vue: 3.2.47 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): - resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} + /unplugin-vue-components@0.25.0(rollup@3.20.2)(vue@3.3.4): + resolution: {integrity: sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 @@ -23755,17 +23815,17 @@ packages: '@nuxt/kit': optional: true dependencies: - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 7.4.2 - resolve: 1.22.1 + minimatch: 9.0.1 + resolve: 1.22.2 unplugin: 1.3.1 - vue: 3.2.47 + vue: 3.3.4 transitivePeerDependencies: - rollup - supports-color @@ -24469,19 +24529,19 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /webdriver@8.10.2: - resolution: {integrity: sha512-xwoY+JtmEwN9hFx00V08PBlLLbuOHnPcO78ImPn6IzlhDW960f/6C8fzP0oiJkDyjQ7U81gHU6Mjkp/tBNpKEQ==} + /webdriver@8.10.7: + resolution: {integrity: sha512-pBy29S9e8IYKYHfS0gp91Jp9SUvXJQckJKJdj+VNLNL9toSFo10N7xRpv8W1f7HkniXrgESi9GHYNyc1J/5lLA==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 '@types/ws': 8.5.4 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 deepmerge-ts: 5.0.0 - got: 12.6.0 + got: 12.6.1 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24509,35 +24569,35 @@ packages: - utf-8-validate dev: true - /webdriverio@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-VrA9oFI17sBhPDvMwywve4CwODHi5FEzjn9gyInN7Nv+6tVaDC+PVGsKV7ZQQSj5C0bzPCn3IgXSoM1Qqn3XeQ==} + /webdriverio@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-TkkPE3zBxdLRdcsNLqHct2OARnfMYB9/A0ri4sccmc3C3dVFiW99NAstN88nzD1SYzXAbxALRuITVd5oswqqhg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 '@wdio/repl': 8.10.1 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 archiver: 5.3.1 aria-query: 5.0.2 css-shorthand-properties: 1.1.1 css-value: 0.0.1 - devtools: 8.10.2(typescript@5.0.4) - devtools-protocol: 0.0.1138159 + devtools: 8.10.7(typescript@5.0.4) + devtools-protocol: 0.0.1149535 grapheme-splitter: 1.0.4 import-meta-resolve: 3.0.0 is-plain-obj: 4.1.0 lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 - minimatch: 9.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + minimatch: 9.0.1 + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 serialize-error: 8.1.0 - webdriver: 8.10.2 + webdriver: 8.10.7 transitivePeerDependencies: - bufferutil - encoding diff --git a/test/core/test/expect.test.ts b/test/core/test/expect.test.ts index 8544a77bc3c9..ce12e36c344d 100644 --- a/test/core/test/expect.test.ts +++ b/test/core/test/expect.test.ts @@ -1,72 +1,43 @@ -import { resolve } from 'node:path' -import type { UserConfig } from 'vitest' -import { describe, expect, expectTypeOf, test } from 'vitest' import { getCurrentTest } from '@vitest/runner' -import { runVitest } from '../../test-utils' +import { describe, expect, expectTypeOf, test } from 'vitest' describe('expect.soft', () => { - const run = (config?: UserConfig) => runVitest({ root: resolve(__dirname, './fixtures/expects'), exclude: [], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) - test('types', () => { - expectTypeOf(expect).toEqualTypeOf(expect) + expectTypeOf(expect.soft).toEqualTypeOf(expect) expectTypeOf(expect.soft(7)).toEqualTypeOf(expect(7)) expectTypeOf(expect.soft(5)).toHaveProperty('toBe') expectTypeOf(expect.soft(7)).not.toHaveProperty('toCustom') }) - test('basic', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 1 to be 2') - expect(stderr).toContain('AssertionError: expected 2 to be 3') - }) - - test('promise', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 2 to be 3') - expect(stderr).toContain('AssertionError: expected 1 to be 2') - }) - - test('with expect', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') - expect(stderr).toContain('AssertionError: expected 10 to deeply equal 20') - expect(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') + test('return value', () => { + expect(expect.soft('test')).toHaveProperty('toBe') + expect(expect.soft('test')).toHaveProperty('toEqual') }) - test('with expect.extend', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 1 to deeply equal 2') - expect(stderr).toContain('Error: expected 3 to be divisible by 4') - expect(stderr).toContain('AssertionError: expected 5 to deeply equal 6') - }) - - test('passed', async () => { - const { stdout } = await run() - expect(stdout).toContain('✓ soft.test.ts > passed') - }) - - test('retry will passed', async () => { - const { stdout } = await run() - expect(stdout).toContain('✓ soft.test.ts > retry will passed') + test('with extend', () => { + expect.extend({ + toBeFoo(received) { + const { isNot } = this + return { + // do not alter your "pass" based on isNot. Vitest does it for you + pass: received === 'foo', + message: () => `${received} is${isNot ? ' not' : ''} foo`, + } + }, + }) + expect(expect.soft('test')).toHaveProperty('toBeFoo') }) - test('retry will failed', async () => { - const { stderr } = await run() - expect(stderr).toContain('AssertionError: expected 1 to be 4') - expect(stderr).toContain('AssertionError: expected 2 to be 5') - expect(stderr).toContain('AssertionError: expected 3 to be 4') - expect(stderr).toContain('AssertionError: expected 4 to be 5') - expect(stderr).toContain('4/4') + test('should have multiple error', () => { + expect.soft(1).toBe(2) + expect.soft(2).toBe(3) + getCurrentTest()!.result!.state = 'run' + expect(getCurrentTest()?.result?.errors).toHaveLength(2) }) - test('using expect.soft for test', async () => { - const { stderr } = await run({ - testNamePattern: 'retry will failed', - }) - expect.soft(stderr).toContain('AssertionError: expected 1 to be 4') - expect.soft(stderr).toContain('AssertionError: expected 2 to be 5') - expect.soft(stderr).toContain('AssertionError: expected 3 to be 4') - expect.soft(stderr).toContain('AssertionError: expected 4 to be 5') - expect.soft(stderr).toContain('4/4') + test.fails('should be a failure', () => { + expect.soft('test1').toBe('test res') + expect.soft('test2').toBe('test res') + expect.soft('test3').toBe('test res') }) -}, 4000) +}) diff --git a/test/core/test/fixtures/expects/soft.test.ts b/test/failing/fixtures/expects/soft.test.ts similarity index 100% rename from test/core/test/fixtures/expects/soft.test.ts rename to test/failing/fixtures/expects/soft.test.ts diff --git a/test/failing/fixtures/vite.config.ts b/test/failing/fixtures/vite.config.ts new file mode 100644 index 000000000000..6d0258279ded --- /dev/null +++ b/test/failing/fixtures/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + test: { + threads: false, + isolate: false, + }, +}) diff --git a/test/failing/package.json b/test/failing/package.json new file mode 100644 index 000000000000..259a709074dd --- /dev/null +++ b/test/failing/package.json @@ -0,0 +1,14 @@ +{ + "name": "@vitest/test-failing", + "private": true, + "scripts": { + "test": "vitest", + "coverage": "vitest run --coverage" + }, + "devDependencies": { + "@vitest/coverage-istanbul": "workspace:*", + "@vitest/runner": "workspace:*", + "jsdom": "^21.0.0", + "vitest": "workspace:*" + } +} diff --git a/test/failing/test/expect.test.ts b/test/failing/test/expect.test.ts new file mode 100644 index 000000000000..43656186f639 --- /dev/null +++ b/test/failing/test/expect.test.ts @@ -0,0 +1,54 @@ +import { resolve } from 'node:path' +import type { UserConfig } from 'vitest' +import { describe, expect, test } from 'vitest' +import { getCurrentTest } from '@vitest/runner' +import { runVitest } from '../../test-utils' + +describe('expect.soft', () => { + const run = (config?: UserConfig) => runVitest({ root: resolve('./fixtures/expects'), include: ['soft.test.ts'], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) + + test('basic', async () => { + const { stderr } = await run() + expect.soft(stderr).toContain('AssertionError: expected 1 to be 2') + expect.soft(stderr).toContain('AssertionError: expected 2 to be 3') + }) + + test('promise', async () => { + const { stderr } = await run() + expect.soft(stderr).toContain('AssertionError: expected 2 to be 3') + expect.soft(stderr).toContain('AssertionError: expected 1 to be 2') + }) + + test('with expect', async () => { + const { stderr } = await run() + expect.soft(stderr).toContain('AssertionError: expected 1 to deeply equal 2') + expect.soft(stderr).toContain('AssertionError: expected 10 to deeply equal 20') + expect.soft(stderr).not.toContain('AssertionError: expected 2 to deeply equal 3') + }) + + test('with expect.extend', async () => { + const { stderr } = await run() + expect.soft(stderr).toContain('AssertionError: expected 1 to deeply equal 2') + expect.soft(stderr).toContain('Error: expected 3 to be divisible by 4') + expect.soft(stderr).toContain('AssertionError: expected 5 to deeply equal 6') + }) + + test('passed', async () => { + const { stdout } = await run() + expect.soft(stdout).toContain('soft.test.ts > passed') + }) + + test('retry will passed', async () => { + const { stdout } = await run() + expect.soft(stdout).toContain('soft.test.ts > retry will passed') + }) + + test('retry will failed', async () => { + const { stderr } = await run() + expect.soft(stderr).toContain('AssertionError: expected 1 to be 4') + expect.soft(stderr).toContain('AssertionError: expected 2 to be 5') + expect.soft(stderr).toContain('AssertionError: expected 3 to be 4') + expect.soft(stderr).toContain('AssertionError: expected 4 to be 5') + expect.soft(stderr).toContain('4/4') + }) +}, 4000) diff --git a/test/failing/vite.config.ts b/test/failing/vite.config.ts new file mode 100644 index 000000000000..a36f56b70ba0 --- /dev/null +++ b/test/failing/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + test: { + include: ['test/*.test.ts'], + chaiConfig: { + truncateThreshold: 9999, + }, + }, +}) From e4652f6cea2c2d2ac64dd1fd21f15a2f7099a67f Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 15:25:57 +0000 Subject: [PATCH 29/39] chore: update lock --- pnpm-lock.yaml | 319 +++++++++++++++++++++---------------------------- 1 file changed, 136 insertions(+), 183 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4033cd034a70..0e431b311e3a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,7 +325,7 @@ importers: version: 20.2.5 '@types/react': specifier: latest - version: 18.2.8 + version: 18.2.7 '@vitejs/plugin-react': specifier: latest version: 4.0.0(vite@4.3.9) @@ -392,7 +392,7 @@ importers: version: link:../../packages/ui happy-dom: specifier: latest - version: 9.20.3 + version: 9.1.9 jsdom: specifier: latest version: 22.1.0 @@ -731,10 +731,10 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.0 - version: 2.0.0(svelte@3.59.1)(vite@4.3.9) + version: 2.0.0(svelte@3.58.0)(vite@4.3.9) '@testing-library/svelte': specifier: ^3.2.2 - version: 3.2.2(svelte@3.59.1) + version: 3.2.2(svelte@3.58.0) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -743,7 +743,7 @@ importers: version: 22.1.0 svelte: specifier: latest - version: 3.59.1 + version: 3.58.0 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -768,10 +768,10 @@ importers: version: 22.1.0 unplugin-auto-import: specifier: latest - version: 0.16.4(rollup@3.20.2) + version: 0.12.1(rollup@3.20.2) unplugin-vue-components: specifier: latest - version: 0.25.0(rollup@3.20.2)(vue@3.3.4) + version: 0.22.12(rollup@3.20.2)(vue@3.3.4) vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -1416,7 +1416,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/base: devDependencies: @@ -1530,7 +1530,7 @@ importers: version: 2.3.2(vue@3.3.4) happy-dom: specifier: latest - version: 9.20.3 + version: 9.1.9 istanbul-lib-coverage: specifier: ^3.2.0 version: 3.2.0 @@ -1545,7 +1545,7 @@ importers: version: 3.3.4 webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/css: devDependencies: @@ -1595,7 +1595,6 @@ importers: vitest: specifier: workspace:* version: link:../../packages/vitest - test/failing: devDependencies: '@vitest/coverage-istanbul': @@ -1610,7 +1609,6 @@ importers: vitest: specifier: workspace:* version: link:../../packages/vitest - test/fails: devDependencies: '@vitest/coverage-istanbul': @@ -1825,7 +1823,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.7(typescript@5.0.4) + version: 8.10.2(typescript@5.0.4) test/web-worker: devDependencies: @@ -2098,10 +2096,6 @@ packages: resolution: {integrity: sha512-vy9fM3pIxZmX07dL+VX1aZe7ynZ+YyB0jY+jE6r3hOK6GNY2t6W8rzpFC4tgpbXUYABkFQwgJq2XYXlxbXAI0g==} dev: true - /@antfu/utils@0.7.4: - resolution: {integrity: sha512-qe8Nmh9rYI/HIspLSTwtbMFPj6dISG6+dJnOguTlPNXtCvS2uezdxscVBb7/3DrmNbQK49TDqpkSQ1chbRGdpQ==} - dev: true - /@apideck/better-ajv-errors@0.3.6(ajv@8.11.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2178,7 +2172,7 @@ packages: gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 - resolve: 1.22.2 + resolve: 1.22.1 semver: 5.7.1 source-map: 0.5.7 transitivePeerDependencies: @@ -2428,7 +2422,7 @@ packages: '@babel/traverse': 7.21.4 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2444,7 +2438,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2460,7 +2454,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.2 + resolve: 1.22.1 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -6359,8 +6353,8 @@ packages: - supports-color dev: true - /@puppeteer/browsers@1.3.0(typescript@5.0.4): - resolution: {integrity: sha512-an3QdbNPkuU6qpxpbssxAbjRLJcF+eP4L8UqIY3+6n0sbaVxw5pz7PiCLy9g32XEZuoamUlV5ZQPnA6FxvkIHA==} + /@puppeteer/browsers@1.0.1(typescript@5.0.4): + resolution: {integrity: sha512-9wkYhON9zBgtjYRE3FcokGCfjG25zjzNAYmsHpiWitRZ/4DeT3v125/fCUU66SaPJ4nUsxGNPgpS1TOcQ+8StA==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -6467,7 +6461,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.22.2 + resolve: 1.22.1 rollup: 2.79.1 dev: true @@ -7976,7 +7970,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.59.1)(vite@4.3.9): + /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.58.0)(vite@4.3.9): resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -7987,8 +7981,8 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.27.0 - svelte: 3.59.1 - svelte-hmr: 0.15.1(svelte@3.59.1) + svelte: 3.58.0 + svelte-hmr: 0.15.1(svelte@3.58.0) vite: 4.3.9(@types/node@18.16.3) vitefu: 0.2.3(vite@4.3.9) transitivePeerDependencies: @@ -8112,14 +8106,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/svelte@3.2.2(svelte@3.59.1): + /@testing-library/svelte@3.2.2(svelte@3.58.0): resolution: {integrity: sha512-IKwZgqbekC3LpoRhSwhd0JswRGxKdAGkf39UiDXTywK61YyLXbCYoR831e/UUC6EeNW4hiHPY+2WuovxOgI5sw==} engines: {node: '>= 10'} peerDependencies: svelte: 3.x dependencies: '@testing-library/dom': 8.17.1 - svelte: 3.59.1 + svelte: 3.58.0 dev: true /@testing-library/user-event@13.5.0(@testing-library/dom@8.17.1): @@ -8266,7 +8260,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/eslint-scope@3.7.4: @@ -8508,19 +8502,19 @@ packages: /@types/react-dom@18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/react-dom@18.0.8: resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: true /@types/react-is@17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: false /@types/react-test-renderer@17.0.2: @@ -8532,7 +8526,7 @@ packages: /@types/react-transition-group@4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.7 dev: false /@types/react@17.0.49: @@ -8551,8 +8545,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react@18.2.8: - resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} + /@types/react@18.2.7: + resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9673,13 +9667,13 @@ packages: vue-demi: 0.14.0(vue@3.2.39) dev: false - /@wdio/config@8.10.7: - resolution: {integrity: sha512-m7JX9X/RPM+4KZQkSUhPHXeS3PJJky0UB62ZLh28TYCzVxEKNq1gFb6Cvqfn+w6Ym/UCFBaZzDrRLLXUAgUifw==} + /@wdio/config@8.10.2: + resolution: {integrity: sha512-CBPyxay3vVlAnwF+Dv2zsM4QMOVg8rOiD1HAdm9BilwbID2RnLF5i0IYNIFsAblhSZQhXkn5BXAcFSEIVHwOgA==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.10.6 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/logger': 8.6.6 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 decamelize: 6.0.0 deepmerge-ts: 5.0.0 glob: 10.2.2 @@ -9701,16 +9695,6 @@ packages: read-pkg-up: 9.1.0 dev: true - /@wdio/logger@8.10.6: - resolution: {integrity: sha512-pJYKecNYS0vu0FxDaii6MYQlYkORDLGdRWi70hrihH20sMZofzMA1tvzRMRk1VTrsUUE4TLJXKdmT2JRMN+OPw==} - engines: {node: ^16.13 || >=18} - dependencies: - chalk: 5.2.0 - loglevel: 1.8.1 - loglevel-plugin-prefix: 0.8.4 - strip-ansi: 7.1.0 - dev: true - /@wdio/logger@8.6.6: resolution: {integrity: sha512-MS+Y5yqFGx2zVXMOfuBQAVdFsP4DuYz+/hM552xwiDWjGg6EZHoccqUYgH3J5zpu3JFpYV3R/a5jExFiGGck6g==} engines: {node: ^16.13 || >=18} @@ -9743,8 +9727,8 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/types@8.10.4: - resolution: {integrity: sha512-aLJ1QQW+hhALeRK3bvMLjIrlUVyhOs3Od+91pR4Z4pLwyeNG1bJZCJRD5bAJK/mm7CnFa0NsdixPS9jJxZcRrw==} + /@wdio/types@8.10.2: + resolution: {integrity: sha512-d0oWX82CVE4Z7ipD2GpPhaeFKh7JDaDNzgiQpPYkS74TBSqQV+yrqvqRlrmHD4nmRgFwnjtD8AFOo7ackeURhg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 @@ -9757,12 +9741,12 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/utils@8.10.7: - resolution: {integrity: sha512-G9r/bQl4J25WPKeW0e+27gqNvG+x7MyZEOICl6SwyBe0SqO7JBFOBARx4oUEp2zQYmnCRNtCrHa7yM/O4OPuKA==} + /@wdio/utils@8.10.2: + resolution: {integrity: sha512-lMIqztb4Mmi2arsM089SDfubx9v0/a/7Ul+vMOt7P19ZEogiWnbELmIs/CaVOxjEcgaNjXM2s56ORKnAObJfgg==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.10.6 - '@wdio/types': 8.10.4 + '@wdio/logger': 8.6.6 + '@wdio/types': 8.10.2 import-meta-resolve: 3.0.0 p-iteration: 1.1.8 dev: true @@ -11745,8 +11729,8 @@ packages: mitt: 3.0.0 dev: true - /chromium-bidi@0.4.9(devtools-protocol@0.0.1120988): - resolution: {integrity: sha512-u3DC6XwgLCA9QJ5ak1voPslCmacQdulZNCPsI3qNXxSnEcZS7DFIbww+5RM2bznMEje7cc0oydavRLRvOIZtHw==} + /chromium-bidi@0.4.7(devtools-protocol@0.0.1120988): + resolution: {integrity: sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==} peerDependencies: devtools-protocol: '*' dependencies: @@ -12281,14 +12265,6 @@ packages: transitivePeerDependencies: - encoding - /cross-fetch@3.1.6: - resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} - dependencies: - node-fetch: 2.6.11 - transitivePeerDependencies: - - encoding - dev: true - /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -12961,28 +12937,28 @@ packages: resolution: {integrity: sha512-LF+0k1kYkrx2dZsvjLyNY2ySydz4lCy/xFvjuI5mCFGnepk5hC9iXbsdFk6jYma0ZvXaTxl3sGTiVr/GC0knyQ==} dev: true - /devtools-protocol@0.0.1149535: - resolution: {integrity: sha512-vpM8tGaYz2nrN9n8rvUEhQCgU05ocejO5WIJySsftEHxUahQ/fWuNyPxXuQNBEmaISYyMZkxCunhjtSEyBl/Dg==} + /devtools-protocol@0.0.1138159: + resolution: {integrity: sha512-IVXe1ZEQJWkMkeg10hRoZu3luP054z8USOpBIyorCTTABKVg0gBGt4rmwjGmThMEKaTb4nEmjVJkZ3/YxU0whA==} dev: true /devtools-protocol@0.0.981744: resolution: {integrity: sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==} dev: true - /devtools@8.10.7(typescript@5.0.4): - resolution: {integrity: sha512-picJDxsjpaOW7gnQjcQVGDXvxuP1RZ4VNJpvJ+qiy86Gf3l4FGLKYkpJJFAMsIugL0XPs89bIVhjbtIv5NGL1w==} + /devtools@8.10.2(typescript@5.0.4): + resolution: {integrity: sha512-pvnTf0GtY1ILgBBxjGpQmwmiIklPQFQNirW4deluoLnhKLt6ekdKjYRLoK7goNN0rYPx7R/KK6Aqe5mgWKxBaA==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 chrome-launcher: 0.15.1 edge-paths: 3.0.5 import-meta-resolve: 3.0.0 - puppeteer-core: 20.3.0(typescript@5.0.4) + puppeteer-core: 20.1.1(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 ua-parser-js: 1.0.34 uuid: 9.0.0 @@ -13972,7 +13948,7 @@ packages: dependencies: debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.11.0 - resolve: 1.22.2 + resolve: 1.22.1 transitivePeerDependencies: - supports-color dev: true @@ -15621,23 +15597,6 @@ packages: responselike: 3.0.0 dev: true - /got@12.6.1: - resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} - engines: {node: '>=14.16'} - dependencies: - '@sindresorhus/is': 5.3.0 - '@szmarczak/http-timer': 5.0.1 - cacheable-lookup: 7.0.0 - cacheable-request: 10.2.8 - decompress-response: 6.0.0 - form-data-encoder: 2.1.4 - get-stream: 6.0.1 - http2-wrapper: 2.2.0 - lowercase-keys: 3.0.0 - p-cancelable: 3.0.0 - responselike: 3.0.0 - dev: true - /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -15684,8 +15643,8 @@ packages: uglify-js: 3.17.0 dev: true - /happy-dom@9.10.7: - resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} + /happy-dom@9.1.9: + resolution: {integrity: sha512-OMbnoknA7iNNG/5fwt1JckCKc53QLLFo2ljzit1pCV9SC1TYwcQj0obq0QUTeqIf2p2skbFG69bo19YoSj/1DA==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -15695,11 +15654,11 @@ packages: whatwg-mimetype: 3.0.0 dev: true - /happy-dom@9.20.3: - resolution: {integrity: sha512-eBsgauT435fXFvQDNcmm5QbGtYzxEzOaX35Ia+h6yP/wwa4xSWZh1CfP+mGby8Hk6Xu59mTkpyf72rUXHNxY7A==} + /happy-dom@9.10.7: + resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} dependencies: css.escape: 1.5.1 - entities: 4.5.0 + he: 1.2.0 iconv-lite: 0.6.3 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 @@ -17279,7 +17238,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) jest-util: 27.5.1 jest-validate: 27.5.1 - resolve: 1.22.2 + resolve: 1.22.1 resolve.exports: 1.1.1 slash: 3.0.0 dev: true @@ -18747,13 +18706,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@9.0.1: - resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true @@ -19236,7 +19188,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 + resolve: 1.22.1 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -20570,8 +20522,8 @@ packages: - utf-8-validate dev: true - /puppeteer-core@20.3.0(typescript@5.0.4): - resolution: {integrity: sha512-264pBrIui5bO6NJeOcbJrLa0OCwmA4+WK00JMrLIKTfRiqe2gx8KWTzLsjyw/bizErp3TKS7vt/I0i5fTC+mAw==} + /puppeteer-core@20.1.1(typescript@5.0.4): + resolution: {integrity: sha512-iB9F2Om8J+nU4qi30oYw0hMWOw6eQN7kFkLLI/u3UvxONOCx5o0KmM6+byaK2/QGIuQu2ly1mPaJnC1DyoW07Q==} engines: {node: '>=16.0.0'} peerDependencies: typescript: '>= 4.7.4' @@ -20579,12 +20531,17 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.3.0(typescript@5.0.4) - chromium-bidi: 0.4.9(devtools-protocol@0.0.1120988) - cross-fetch: 3.1.6 + '@puppeteer/browsers': 1.0.1(typescript@5.0.4) + chromium-bidi: 0.4.7(devtools-protocol@0.0.1120988) + cross-fetch: 3.1.5 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1120988 + extract-zip: 2.0.1(supports-color@8.1.1) + https-proxy-agent: 5.0.1 + proxy-from-env: 1.1.0 + tar-fs: 2.1.1 typescript: 5.0.4 + unbzip2-stream: 1.4.3 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -20781,7 +20738,7 @@ packages: estree-to-babel: 3.2.1 neo-async: 2.6.2 node-dir: 0.1.17 - resolve: 1.22.2 + resolve: 1.22.1 strip-indent: 3.0.0 transitivePeerDependencies: - supports-color @@ -21422,15 +21379,6 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} - hasBin: true - dependencies: - is-core-module: 2.11.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} @@ -22510,13 +22458,6 @@ packages: ansi-regex: 6.0.1 dev: true - /strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} engines: {node: '>=0.10.0'} @@ -22696,17 +22637,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr@0.15.1(svelte@3.59.1): + /svelte-hmr@0.15.1(svelte@3.58.0): resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.59.1 + svelte: 3.58.0 dev: true - /svelte@3.59.1: - resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} + /svelte@3.58.0: + resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} engines: {node: '>= 8'} dev: true @@ -23489,6 +23430,24 @@ packages: vfile: 4.2.1 dev: true + /unimport@1.3.0(rollup@3.20.2): + resolution: {integrity: sha512-fOkrdxglsHd428yegH0wPH/6IfaSdDeMXtdRGn6en/ccyzc2aaoxiUTMrJyc6Bu+xoa18RJRPMfLUHEzjz8atw==} + dependencies: + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + escape-string-regexp: 5.0.0 + fast-glob: 3.2.12 + local-pkg: 0.4.3 + magic-string: 0.27.0 + mlly: 1.3.0 + pathe: 1.1.0 + pkg-types: 1.0.3 + scule: 1.0.0 + strip-literal: 1.0.1 + unplugin: 1.3.1 + transitivePeerDependencies: + - rollup + dev: true + /unimport@3.0.6(rollup@3.20.2): resolution: {integrity: sha512-GYxGJ1Bri1oqx8VFDjdgooGzeK7jBk3bvhXmamTIpu3nONOcUMGwZbX7X0L5RA7OWMXpR4vzpSQP7pXUzJg1/Q==} dependencies: @@ -23697,32 +23656,27 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): - resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} + /unplugin-auto-import@0.12.1(rollup@3.20.2): + resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} engines: {node: '>=14'} peerDependencies: - '@nuxt/kit': ^3.2.2 '@vueuse/core': '*' peerDependenciesMeta: - '@nuxt/kit': - optional: true '@vueuse/core': optional: true dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 - magic-string: 0.30.0 - minimatch: 9.0.0 - unimport: 3.0.6(rollup@3.20.2) + magic-string: 0.27.0 + unimport: 1.3.0(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-auto-import@0.16.4(rollup@3.20.2): - resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==} + /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): + resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -23733,39 +23687,38 @@ packages: '@vueuse/core': optional: true dependencies: - '@antfu/utils': 0.7.4 + '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.1 - unimport: 3.0.7(rollup@3.20.2) + minimatch: 9.0.0 + unimport: 3.0.6(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): - resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} + /unplugin-vue-components@0.22.12(rollup@3.20.2)(vue@3.3.4): + resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 - '@nuxt/kit': ^3.2.2 vue: 2 || 3 peerDependenciesMeta: '@babel/parser': optional: true - '@nuxt/kit': - optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@2.79.1) + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 - magic-string: 0.30.0 - minimatch: 7.4.2 + magic-string: 0.27.0 + minimatch: 5.1.1 resolve: 1.22.1 + unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 vue: 3.3.4 transitivePeerDependencies: @@ -23773,7 +23726,7 @@ packages: - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): + /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: @@ -23787,7 +23740,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.2(rollup@2.79.1) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 @@ -23796,14 +23749,14 @@ packages: minimatch: 7.4.2 resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.2.47 + vue: 3.3.4 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin-vue-components@0.25.0(rollup@3.20.2)(vue@3.3.4): - resolution: {integrity: sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==} + /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): + resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 @@ -23815,17 +23768,17 @@ packages: '@nuxt/kit': optional: true dependencies: - '@antfu/utils': 0.7.4 + '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.1 - resolve: 1.22.2 + minimatch: 7.4.2 + resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.3.4 + vue: 3.2.47 transitivePeerDependencies: - rollup - supports-color @@ -24529,19 +24482,19 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /webdriver@8.10.7: - resolution: {integrity: sha512-pBy29S9e8IYKYHfS0gp91Jp9SUvXJQckJKJdj+VNLNL9toSFo10N7xRpv8W1f7HkniXrgESi9GHYNyc1J/5lLA==} + /webdriver@8.10.2: + resolution: {integrity: sha512-xwoY+JtmEwN9hFx00V08PBlLLbuOHnPcO78ImPn6IzlhDW960f/6C8fzP0oiJkDyjQ7U81gHU6Mjkp/tBNpKEQ==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 '@types/ws': 8.5.4 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 deepmerge-ts: 5.0.0 - got: 12.6.1 + got: 12.6.0 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24569,35 +24522,35 @@ packages: - utf-8-validate dev: true - /webdriverio@8.10.7(typescript@5.0.4): - resolution: {integrity: sha512-TkkPE3zBxdLRdcsNLqHct2OARnfMYB9/A0ri4sccmc3C3dVFiW99NAstN88nzD1SYzXAbxALRuITVd5oswqqhg==} + /webdriverio@8.10.2(typescript@5.0.4): + resolution: {integrity: sha512-VrA9oFI17sBhPDvMwywve4CwODHi5FEzjn9gyInN7Nv+6tVaDC+PVGsKV7ZQQSj5C0bzPCn3IgXSoM1Qqn3XeQ==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.7 - '@wdio/logger': 8.10.6 + '@wdio/config': 8.10.2 + '@wdio/logger': 8.6.6 '@wdio/protocols': 8.10.2 '@wdio/repl': 8.10.1 - '@wdio/types': 8.10.4 - '@wdio/utils': 8.10.7 + '@wdio/types': 8.10.2 + '@wdio/utils': 8.10.2 archiver: 5.3.1 aria-query: 5.0.2 css-shorthand-properties: 1.1.1 css-value: 0.0.1 - devtools: 8.10.7(typescript@5.0.4) - devtools-protocol: 0.0.1149535 + devtools: 8.10.2(typescript@5.0.4) + devtools-protocol: 0.0.1138159 grapheme-splitter: 1.0.4 import-meta-resolve: 3.0.0 is-plain-obj: 4.1.0 lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 - minimatch: 9.0.1 - puppeteer-core: 20.3.0(typescript@5.0.4) + minimatch: 9.0.0 + puppeteer-core: 20.1.1(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 serialize-error: 8.1.0 - webdriver: 8.10.7 + webdriver: 8.10.2 transitivePeerDependencies: - bufferutil - encoding From 770d11f5235a2154701f21f726e6aa3c3fc3d3c7 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 15:34:14 +0000 Subject: [PATCH 30/39] chore: update lock --- pnpm-lock.yaml | 321 ++++++++++++++++++++++++++++--------------------- 1 file changed, 184 insertions(+), 137 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e431b311e3a..c4ce586bc285 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,7 +325,7 @@ importers: version: 20.2.5 '@types/react': specifier: latest - version: 18.2.7 + version: 18.2.8 '@vitejs/plugin-react': specifier: latest version: 4.0.0(vite@4.3.9) @@ -392,7 +392,7 @@ importers: version: link:../../packages/ui happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 jsdom: specifier: latest version: 22.1.0 @@ -731,10 +731,10 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.0 - version: 2.0.0(svelte@3.58.0)(vite@4.3.9) + version: 2.0.0(svelte@3.59.1)(vite@4.3.9) '@testing-library/svelte': specifier: ^3.2.2 - version: 3.2.2(svelte@3.58.0) + version: 3.2.2(svelte@3.59.1) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -743,7 +743,7 @@ importers: version: 22.1.0 svelte: specifier: latest - version: 3.58.0 + version: 3.59.1 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -768,10 +768,10 @@ importers: version: 22.1.0 unplugin-auto-import: specifier: latest - version: 0.12.1(rollup@3.20.2) + version: 0.16.4(rollup@3.20.2) unplugin-vue-components: specifier: latest - version: 0.22.12(rollup@3.20.2)(vue@3.3.4) + version: 0.25.0(rollup@3.20.2)(vue@3.3.4) vite: specifier: ^4.3.9 version: 4.3.9(@types/node@18.16.3) @@ -1416,7 +1416,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/base: devDependencies: @@ -1530,7 +1530,7 @@ importers: version: 2.3.2(vue@3.3.4) happy-dom: specifier: latest - version: 9.1.9 + version: 9.20.3 istanbul-lib-coverage: specifier: ^3.2.0 version: 3.2.0 @@ -1545,7 +1545,7 @@ importers: version: 3.3.4 webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/css: devDependencies: @@ -1595,6 +1595,7 @@ importers: vitest: specifier: workspace:* version: link:../../packages/vitest + test/failing: devDependencies: '@vitest/coverage-istanbul': @@ -1609,6 +1610,7 @@ importers: vitest: specifier: workspace:* version: link:../../packages/vitest + test/fails: devDependencies: '@vitest/coverage-istanbul': @@ -1823,7 +1825,7 @@ importers: version: link:../../packages/vitest webdriverio: specifier: latest - version: 8.10.2(typescript@5.0.4) + version: 8.10.7(typescript@5.0.4) test/web-worker: devDependencies: @@ -2096,6 +2098,10 @@ packages: resolution: {integrity: sha512-vy9fM3pIxZmX07dL+VX1aZe7ynZ+YyB0jY+jE6r3hOK6GNY2t6W8rzpFC4tgpbXUYABkFQwgJq2XYXlxbXAI0g==} dev: true + /@antfu/utils@0.7.4: + resolution: {integrity: sha512-qe8Nmh9rYI/HIspLSTwtbMFPj6dISG6+dJnOguTlPNXtCvS2uezdxscVBb7/3DrmNbQK49TDqpkSQ1chbRGdpQ==} + dev: true + /@apideck/better-ajv-errors@0.3.6(ajv@8.11.0): resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} engines: {node: '>=10'} @@ -2172,7 +2178,7 @@ packages: gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 source-map: 0.5.7 transitivePeerDependencies: @@ -2422,7 +2428,7 @@ packages: '@babel/traverse': 7.21.4 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2438,7 +2444,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -2454,7 +2460,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4(supports-color@8.1.1) lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -5490,7 +5496,7 @@ packages: resolution: {integrity: sha512-6MvDI+I6QMvXn5rK9KQGdpEE4mmLTcuQdLZEiX5N+uZB+vc4Yw9K1OtnOgkl8mp4d9X0UrILREyZgF1NUwUt+Q==} dependencies: '@antfu/install-pkg': 0.1.1 - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@iconify/types': 2.0.0 debug: 4.3.4(supports-color@8.1.1) kolorist: 1.7.0 @@ -6353,8 +6359,8 @@ packages: - supports-color dev: true - /@puppeteer/browsers@1.0.1(typescript@5.0.4): - resolution: {integrity: sha512-9wkYhON9zBgtjYRE3FcokGCfjG25zjzNAYmsHpiWitRZ/4DeT3v125/fCUU66SaPJ4nUsxGNPgpS1TOcQ+8StA==} + /@puppeteer/browsers@1.3.0(typescript@5.0.4): + resolution: {integrity: sha512-an3QdbNPkuU6qpxpbssxAbjRLJcF+eP4L8UqIY3+6n0sbaVxw5pz7PiCLy9g32XEZuoamUlV5ZQPnA6FxvkIHA==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -6461,7 +6467,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.2.2 is-module: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 2.79.1 dev: true @@ -7970,7 +7976,7 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.58.0)(vite@4.3.9): + /@sveltejs/vite-plugin-svelte@2.0.0(svelte@3.59.1)(vite@4.3.9): resolution: {integrity: sha512-oUFrYQarRv4fppmxdrv00qw3wX8Ycdj0uv33MfpRZyR8K67dyxiOcHnqkB0zSy5sDJA8RC/2aNtYhXJ8NINVHQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -7981,8 +7987,8 @@ packages: deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.27.0 - svelte: 3.58.0 - svelte-hmr: 0.15.1(svelte@3.58.0) + svelte: 3.59.1 + svelte-hmr: 0.15.1(svelte@3.59.1) vite: 4.3.9(@types/node@18.16.3) vitefu: 0.2.3(vite@4.3.9) transitivePeerDependencies: @@ -8106,14 +8112,14 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/svelte@3.2.2(svelte@3.58.0): + /@testing-library/svelte@3.2.2(svelte@3.59.1): resolution: {integrity: sha512-IKwZgqbekC3LpoRhSwhd0JswRGxKdAGkf39UiDXTywK61YyLXbCYoR831e/UUC6EeNW4hiHPY+2WuovxOgI5sw==} engines: {node: '>= 10'} peerDependencies: svelte: 3.x dependencies: '@testing-library/dom': 8.17.1 - svelte: 3.58.0 + svelte: 3.59.1 dev: true /@testing-library/user-event@13.5.0(@testing-library/dom@8.17.1): @@ -8260,7 +8266,7 @@ packages: resolution: {integrity: sha512-xryQlOEIe1TduDWAOphR0ihfebKFSWOXpIsk+70JskCfRfW+xALdnJ0r1ZOTo85F9Qsjk6vtlU7edTYHbls9tA==} dependencies: '@types/cheerio': 0.22.31 - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/eslint-scope@3.7.4: @@ -8502,19 +8508,19 @@ packages: /@types/react-dom@18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-dom@18.0.8: resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: true /@types/react-is@17.0.3: resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react-test-renderer@17.0.2: @@ -8526,7 +8532,7 @@ packages: /@types/react-transition-group@4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.2.7 + '@types/react': 18.2.8 dev: false /@types/react@17.0.49: @@ -8545,8 +8551,8 @@ packages: csstype: 3.1.0 dev: true - /@types/react@18.2.7: - resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} + /@types/react@18.2.8: + resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 @@ -9667,13 +9673,13 @@ packages: vue-demi: 0.14.0(vue@3.2.39) dev: false - /@wdio/config@8.10.2: - resolution: {integrity: sha512-CBPyxay3vVlAnwF+Dv2zsM4QMOVg8rOiD1HAdm9BilwbID2RnLF5i0IYNIFsAblhSZQhXkn5BXAcFSEIVHwOgA==} + /@wdio/config@8.10.7: + resolution: {integrity: sha512-m7JX9X/RPM+4KZQkSUhPHXeS3PJJky0UB62ZLh28TYCzVxEKNq1gFb6Cvqfn+w6Ym/UCFBaZzDrRLLXUAgUifw==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 decamelize: 6.0.0 deepmerge-ts: 5.0.0 glob: 10.2.2 @@ -9695,6 +9701,16 @@ packages: read-pkg-up: 9.1.0 dev: true + /@wdio/logger@8.10.6: + resolution: {integrity: sha512-pJYKecNYS0vu0FxDaii6MYQlYkORDLGdRWi70hrihH20sMZofzMA1tvzRMRk1VTrsUUE4TLJXKdmT2JRMN+OPw==} + engines: {node: ^16.13 || >=18} + dependencies: + chalk: 5.2.0 + loglevel: 1.8.1 + loglevel-plugin-prefix: 0.8.4 + strip-ansi: 7.1.0 + dev: true + /@wdio/logger@8.6.6: resolution: {integrity: sha512-MS+Y5yqFGx2zVXMOfuBQAVdFsP4DuYz+/hM552xwiDWjGg6EZHoccqUYgH3J5zpu3JFpYV3R/a5jExFiGGck6g==} engines: {node: ^16.13 || >=18} @@ -9727,8 +9743,8 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/types@8.10.2: - resolution: {integrity: sha512-d0oWX82CVE4Z7ipD2GpPhaeFKh7JDaDNzgiQpPYkS74TBSqQV+yrqvqRlrmHD4nmRgFwnjtD8AFOo7ackeURhg==} + /@wdio/types@8.10.4: + resolution: {integrity: sha512-aLJ1QQW+hhALeRK3bvMLjIrlUVyhOs3Od+91pR4Z4pLwyeNG1bJZCJRD5bAJK/mm7CnFa0NsdixPS9jJxZcRrw==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 @@ -9741,12 +9757,12 @@ packages: '@types/node': 18.16.3 dev: true - /@wdio/utils@8.10.2: - resolution: {integrity: sha512-lMIqztb4Mmi2arsM089SDfubx9v0/a/7Ul+vMOt7P19ZEogiWnbELmIs/CaVOxjEcgaNjXM2s56ORKnAObJfgg==} + /@wdio/utils@8.10.7: + resolution: {integrity: sha512-G9r/bQl4J25WPKeW0e+27gqNvG+x7MyZEOICl6SwyBe0SqO7JBFOBARx4oUEp2zQYmnCRNtCrHa7yM/O4OPuKA==} engines: {node: ^16.13 || >=18} dependencies: - '@wdio/logger': 8.6.6 - '@wdio/types': 8.10.2 + '@wdio/logger': 8.10.6 + '@wdio/types': 8.10.4 import-meta-resolve: 3.0.0 p-iteration: 1.1.8 dev: true @@ -10829,7 +10845,7 @@ packages: dependencies: '@babel/runtime': 7.18.9 cosmiconfig: 7.0.1 - resolve: 1.22.1 + resolve: 1.22.2 /babel-plugin-polyfill-corejs2@0.3.2(@babel/core@7.18.13): resolution: {integrity: sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q==} @@ -11729,8 +11745,8 @@ packages: mitt: 3.0.0 dev: true - /chromium-bidi@0.4.7(devtools-protocol@0.0.1120988): - resolution: {integrity: sha512-6+mJuFXwTMU6I3vYLs6IL8A1DyQTPjCfIL971X0aMPVGRbGnNfl6i6Cl0NMbxi2bRYLGESt9T2ZIMRM5PAEcIQ==} + /chromium-bidi@0.4.9(devtools-protocol@0.0.1120988): + resolution: {integrity: sha512-u3DC6XwgLCA9QJ5ak1voPslCmacQdulZNCPsI3qNXxSnEcZS7DFIbww+5RM2bznMEje7cc0oydavRLRvOIZtHw==} peerDependencies: devtools-protocol: '*' dependencies: @@ -12265,6 +12281,14 @@ packages: transitivePeerDependencies: - encoding + /cross-fetch@3.1.6: + resolution: {integrity: sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==} + dependencies: + node-fetch: 2.6.11 + transitivePeerDependencies: + - encoding + dev: true + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -12937,28 +12961,28 @@ packages: resolution: {integrity: sha512-LF+0k1kYkrx2dZsvjLyNY2ySydz4lCy/xFvjuI5mCFGnepk5hC9iXbsdFk6jYma0ZvXaTxl3sGTiVr/GC0knyQ==} dev: true - /devtools-protocol@0.0.1138159: - resolution: {integrity: sha512-IVXe1ZEQJWkMkeg10hRoZu3luP054z8USOpBIyorCTTABKVg0gBGt4rmwjGmThMEKaTb4nEmjVJkZ3/YxU0whA==} + /devtools-protocol@0.0.1149535: + resolution: {integrity: sha512-vpM8tGaYz2nrN9n8rvUEhQCgU05ocejO5WIJySsftEHxUahQ/fWuNyPxXuQNBEmaISYyMZkxCunhjtSEyBl/Dg==} dev: true /devtools-protocol@0.0.981744: resolution: {integrity: sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==} dev: true - /devtools@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-pvnTf0GtY1ILgBBxjGpQmwmiIklPQFQNirW4deluoLnhKLt6ekdKjYRLoK7goNN0rYPx7R/KK6Aqe5mgWKxBaA==} + /devtools@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-picJDxsjpaOW7gnQjcQVGDXvxuP1RZ4VNJpvJ+qiy86Gf3l4FGLKYkpJJFAMsIugL0XPs89bIVhjbtIv5NGL1w==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 chrome-launcher: 0.15.1 edge-paths: 3.0.5 import-meta-resolve: 3.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 ua-parser-js: 1.0.34 uuid: 9.0.0 @@ -13948,7 +13972,7 @@ packages: dependencies: debug: 3.2.7(supports-color@8.1.1) is-core-module: 2.11.0 - resolve: 1.22.1 + resolve: 1.22.2 transitivePeerDependencies: - supports-color dev: true @@ -15473,7 +15497,7 @@ packages: dependencies: foreground-child: 3.1.1 jackspeak: 2.1.1 - minimatch: 9.0.0 + minimatch: 9.0.1 minipass: 5.0.0 path-scurry: 1.7.0 dev: true @@ -15597,6 +15621,23 @@ packages: responselike: 3.0.0 dev: true + /got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + dependencies: + '@sindresorhus/is': 5.3.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.8 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.0 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + dev: true + /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -15643,8 +15684,8 @@ packages: uglify-js: 3.17.0 dev: true - /happy-dom@9.1.9: - resolution: {integrity: sha512-OMbnoknA7iNNG/5fwt1JckCKc53QLLFo2ljzit1pCV9SC1TYwcQj0obq0QUTeqIf2p2skbFG69bo19YoSj/1DA==} + /happy-dom@9.10.7: + resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} dependencies: css.escape: 1.5.1 he: 1.2.0 @@ -15654,11 +15695,11 @@ packages: whatwg-mimetype: 3.0.0 dev: true - /happy-dom@9.10.7: - resolution: {integrity: sha512-AF9qCTEDmwY+4Rc+YQ9mHSFuw7dxwhLeSnNMJWGKUsOz3VWsC7O9kniuil5yVgnpx9UIzAjtK9UdbuRKMSGfSQ==} + /happy-dom@9.20.3: + resolution: {integrity: sha512-eBsgauT435fXFvQDNcmm5QbGtYzxEzOaX35Ia+h6yP/wwa4xSWZh1CfP+mGby8Hk6Xu59mTkpyf72rUXHNxY7A==} dependencies: css.escape: 1.5.1 - he: 1.2.0 + entities: 4.5.0 iconv-lite: 0.6.3 webidl-conversions: 7.0.0 whatwg-encoding: 2.0.0 @@ -17238,7 +17279,7 @@ packages: jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) jest-util: 27.5.1 jest-validate: 27.5.1 - resolve: 1.22.1 + resolve: 1.22.2 resolve.exports: 1.1.1 slash: 3.0.0 dev: true @@ -18706,6 +18747,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.1: + resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true @@ -19188,7 +19236,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -20522,8 +20570,8 @@ packages: - utf-8-validate dev: true - /puppeteer-core@20.1.1(typescript@5.0.4): - resolution: {integrity: sha512-iB9F2Om8J+nU4qi30oYw0hMWOw6eQN7kFkLLI/u3UvxONOCx5o0KmM6+byaK2/QGIuQu2ly1mPaJnC1DyoW07Q==} + /puppeteer-core@20.3.0(typescript@5.0.4): + resolution: {integrity: sha512-264pBrIui5bO6NJeOcbJrLa0OCwmA4+WK00JMrLIKTfRiqe2gx8KWTzLsjyw/bizErp3TKS7vt/I0i5fTC+mAw==} engines: {node: '>=16.0.0'} peerDependencies: typescript: '>= 4.7.4' @@ -20531,17 +20579,12 @@ packages: typescript: optional: true dependencies: - '@puppeteer/browsers': 1.0.1(typescript@5.0.4) - chromium-bidi: 0.4.7(devtools-protocol@0.0.1120988) - cross-fetch: 3.1.5 + '@puppeteer/browsers': 1.3.0(typescript@5.0.4) + chromium-bidi: 0.4.9(devtools-protocol@0.0.1120988) + cross-fetch: 3.1.6 debug: 4.3.4(supports-color@8.1.1) devtools-protocol: 0.0.1120988 - extract-zip: 2.0.1(supports-color@8.1.1) - https-proxy-agent: 5.0.1 - proxy-from-env: 1.1.0 - tar-fs: 2.1.1 typescript: 5.0.4 - unbzip2-stream: 1.4.3 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -20738,7 +20781,7 @@ packages: estree-to-babel: 3.2.1 neo-async: 2.6.2 node-dir: 0.1.17 - resolve: 1.22.1 + resolve: 1.22.2 strip-indent: 3.0.0 transitivePeerDependencies: - supports-color @@ -21378,6 +21421,15 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 /responselike@3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} @@ -22458,6 +22510,13 @@ packages: ansi-regex: 6.0.1 dev: true + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + /strip-bom@2.0.0: resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} engines: {node: '>=0.10.0'} @@ -22637,17 +22696,17 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr@0.15.1(svelte@3.58.0): + /svelte-hmr@0.15.1(svelte@3.59.1): resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: svelte: '>=3.19.0' dependencies: - svelte: 3.58.0 + svelte: 3.59.1 dev: true - /svelte@3.58.0: - resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} + /svelte@3.59.1: + resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} engines: {node: '>= 8'} dev: true @@ -23430,24 +23489,6 @@ packages: vfile: 4.2.1 dev: true - /unimport@1.3.0(rollup@3.20.2): - resolution: {integrity: sha512-fOkrdxglsHd428yegH0wPH/6IfaSdDeMXtdRGn6en/ccyzc2aaoxiUTMrJyc6Bu+xoa18RJRPMfLUHEzjz8atw==} - dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - escape-string-regexp: 5.0.0 - fast-glob: 3.2.12 - local-pkg: 0.4.3 - magic-string: 0.27.0 - mlly: 1.3.0 - pathe: 1.1.0 - pkg-types: 1.0.3 - scule: 1.0.0 - strip-literal: 1.0.1 - unplugin: 1.3.1 - transitivePeerDependencies: - - rollup - dev: true - /unimport@3.0.6(rollup@3.20.2): resolution: {integrity: sha512-GYxGJ1Bri1oqx8VFDjdgooGzeK7jBk3bvhXmamTIpu3nONOcUMGwZbX7X0L5RA7OWMXpR4vzpSQP7pXUzJg1/Q==} dependencies: @@ -23656,27 +23697,32 @@ packages: engines: {node: '>= 0.8'} dev: true - /unplugin-auto-import@0.12.1(rollup@3.20.2): - resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} + /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): + resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} engines: {node: '>=14'} peerDependencies: + '@nuxt/kit': ^3.2.2 '@vueuse/core': '*' peerDependenciesMeta: + '@nuxt/kit': + optional: true '@vueuse/core': optional: true dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 - magic-string: 0.27.0 - unimport: 1.3.0(rollup@3.20.2) + magic-string: 0.30.0 + minimatch: 9.0.0 + unimport: 3.0.6(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-auto-import@0.15.3(@vueuse/core@10.1.2)(rollup@3.20.2): - resolution: {integrity: sha512-RLT8SqbPn4bT7yBshZId0uPSofKWnwr66RyDaxWaFb/+f7OTDOWAsVNz+hOQLBWSjvbekr2xZY9ccS8TDHJbCQ==} + /unplugin-auto-import@0.16.4(rollup@3.20.2): + resolution: {integrity: sha512-xdgBa9NAS3JG8HjkAZHSbGSMlrjKpaWKXGUzaF6RzEtr980RCl1t0Zsu0skUInNYrEQfqaHc7aGWPv41DLTK/w==} engines: {node: '>=14'} peerDependencies: '@nuxt/kit': ^3.2.2 @@ -23689,36 +23735,37 @@ packages: dependencies: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - '@vueuse/core': 10.1.2(vue@3.2.47) local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 9.0.0 - unimport: 3.0.6(rollup@3.20.2) + minimatch: 9.0.1 + unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true - /unplugin-vue-components@0.22.12(rollup@3.20.2)(vue@3.3.4): - resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} + /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 + '@nuxt/kit': ^3.2.2 vue: 2 || 3 peerDependenciesMeta: '@babel/parser': optional: true + '@nuxt/kit': + optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@rollup/pluginutils': 5.0.2(rollup@2.79.1) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 - magic-string: 0.27.0 - minimatch: 5.1.1 + magic-string: 0.30.0 + minimatch: 7.4.2 resolve: 1.22.1 - unimport: 3.0.7(rollup@3.20.2) unplugin: 1.3.1 vue: 3.3.4 transitivePeerDependencies: @@ -23726,7 +23773,7 @@ packages: - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@2.79.1)(vue@3.3.4): + /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} engines: {node: '>=14'} peerDependencies: @@ -23740,7 +23787,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@2.79.1) + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 @@ -23749,14 +23796,14 @@ packages: minimatch: 7.4.2 resolve: 1.22.1 unplugin: 1.3.1 - vue: 3.3.4 + vue: 3.2.47 transitivePeerDependencies: - rollup - supports-color dev: true - /unplugin-vue-components@0.24.1(rollup@3.20.2)(vue@3.2.47): - resolution: {integrity: sha512-T3A8HkZoIE1Cja95xNqolwza0yD5IVlgZZ1PVAGvVCx8xthmjsv38xWRCtHtwl+rvZyL9uif42SRkDGw9aCfMA==} + /unplugin-vue-components@0.25.0(rollup@3.20.2)(vue@3.3.4): + resolution: {integrity: sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==} engines: {node: '>=14'} peerDependencies: '@babel/parser': ^7.15.8 @@ -23768,17 +23815,17 @@ packages: '@nuxt/kit': optional: true dependencies: - '@antfu/utils': 0.7.2 + '@antfu/utils': 0.7.4 '@rollup/pluginutils': 5.0.2(rollup@3.20.2) chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.2.12 local-pkg: 0.4.3 magic-string: 0.30.0 - minimatch: 7.4.2 - resolve: 1.22.1 + minimatch: 9.0.1 + resolve: 1.22.2 unplugin: 1.3.1 - vue: 3.2.47 + vue: 3.3.4 transitivePeerDependencies: - rollup - supports-color @@ -24482,19 +24529,19 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /webdriver@8.10.2: - resolution: {integrity: sha512-xwoY+JtmEwN9hFx00V08PBlLLbuOHnPcO78ImPn6IzlhDW960f/6C8fzP0oiJkDyjQ7U81gHU6Mjkp/tBNpKEQ==} + /webdriver@8.10.7: + resolution: {integrity: sha512-pBy29S9e8IYKYHfS0gp91Jp9SUvXJQckJKJdj+VNLNL9toSFo10N7xRpv8W1f7HkniXrgESi9GHYNyc1J/5lLA==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 '@types/ws': 8.5.4 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 deepmerge-ts: 5.0.0 - got: 12.6.0 + got: 12.6.1 ky: 0.33.3 ws: 8.13.0 transitivePeerDependencies: @@ -24522,35 +24569,35 @@ packages: - utf-8-validate dev: true - /webdriverio@8.10.2(typescript@5.0.4): - resolution: {integrity: sha512-VrA9oFI17sBhPDvMwywve4CwODHi5FEzjn9gyInN7Nv+6tVaDC+PVGsKV7ZQQSj5C0bzPCn3IgXSoM1Qqn3XeQ==} + /webdriverio@8.10.7(typescript@5.0.4): + resolution: {integrity: sha512-TkkPE3zBxdLRdcsNLqHct2OARnfMYB9/A0ri4sccmc3C3dVFiW99NAstN88nzD1SYzXAbxALRuITVd5oswqqhg==} engines: {node: ^16.13 || >=18} dependencies: '@types/node': 20.2.5 - '@wdio/config': 8.10.2 - '@wdio/logger': 8.6.6 + '@wdio/config': 8.10.7 + '@wdio/logger': 8.10.6 '@wdio/protocols': 8.10.2 '@wdio/repl': 8.10.1 - '@wdio/types': 8.10.2 - '@wdio/utils': 8.10.2 + '@wdio/types': 8.10.4 + '@wdio/utils': 8.10.7 archiver: 5.3.1 aria-query: 5.0.2 css-shorthand-properties: 1.1.1 css-value: 0.0.1 - devtools: 8.10.2(typescript@5.0.4) - devtools-protocol: 0.0.1138159 + devtools: 8.10.7(typescript@5.0.4) + devtools-protocol: 0.0.1149535 grapheme-splitter: 1.0.4 import-meta-resolve: 3.0.0 is-plain-obj: 4.1.0 lodash.clonedeep: 4.5.0 lodash.zip: 4.2.0 minimatch: 9.0.0 - puppeteer-core: 20.1.1(typescript@5.0.4) + puppeteer-core: 20.3.0(typescript@5.0.4) query-selector-shadow-dom: 1.0.1 resq: 1.11.0 rgb2hex: 0.2.5 serialize-error: 8.1.0 - webdriver: 8.10.2 + webdriver: 8.10.7 transitivePeerDependencies: - bufferutil - encoding From e9ee91b6976d45150970078d8e65bcd08f16999d Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 5 Jun 2023 17:34:10 +0000 Subject: [PATCH 31/39] test: up --- pnpm-lock.yaml | 6 ------ test/failing/package.json | 2 -- test/failing/test/expect.test.ts | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f837d0e960d..48b4d8ca0303 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1598,15 +1598,9 @@ importers: test/failing: devDependencies: - '@vitest/coverage-istanbul': - specifier: workspace:* - version: link:../../packages/coverage-istanbul '@vitest/runner': specifier: workspace:* version: link:../../packages/runner - jsdom: - specifier: ^21.0.0 - version: 21.0.0 vitest: specifier: workspace:* version: link:../../packages/vitest diff --git a/test/failing/package.json b/test/failing/package.json index 259a709074dd..6bba674dcb7e 100644 --- a/test/failing/package.json +++ b/test/failing/package.json @@ -6,9 +6,7 @@ "coverage": "vitest run --coverage" }, "devDependencies": { - "@vitest/coverage-istanbul": "workspace:*", "@vitest/runner": "workspace:*", - "jsdom": "^21.0.0", "vitest": "workspace:*" } } diff --git a/test/failing/test/expect.test.ts b/test/failing/test/expect.test.ts index 43656186f639..852684adf778 100644 --- a/test/failing/test/expect.test.ts +++ b/test/failing/test/expect.test.ts @@ -5,7 +5,7 @@ import { getCurrentTest } from '@vitest/runner' import { runVitest } from '../../test-utils' describe('expect.soft', () => { - const run = (config?: UserConfig) => runVitest({ root: resolve('./fixtures/expects'), include: ['soft.test.ts'], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) + const run = (config?: UserConfig) => runVitest({ root: resolve('./fixtures'), include: ['expects/soft.test.ts'], setupFiles: [], testNamePattern: getCurrentTest()?.name, testTimeout: 4000, ...config }, ['soft']) test('basic', async () => { const { stderr } = await run() From c67e3bffebf8f249d35c46731ad5ea9b5d3d56e9 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 10:25:22 +0000 Subject: [PATCH 32/39] fix: getting error when run outside of the test --- packages/expect/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index b4374fcf7e80..d29df789c93f 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -30,7 +30,7 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic ? test.context.expect.getState() : getState((globalThis as any)[GLOBAL_EXPECT]) - if (!state.soft) + if (!test || !state.soft) return fn.apply(this, args) try { From 95fbde724173c5e683df0130fae5879b87304074 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 10:32:07 +0000 Subject: [PATCH 33/39] feat: cast types --- packages/expect/package.json | 1 + packages/expect/src/jest-expect.ts | 5 +++-- packages/expect/src/utils.ts | 10 ++++++---- pnpm-lock.yaml | 5 ++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/expect/package.json b/packages/expect/package.json index f8d93a553eff..7cbb30fe3886 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -39,6 +39,7 @@ "chai": "^4.3.7" }, "devDependencies": { + "@vitest/expect": "workspace:*", "picocolors": "^1.0.0" } } diff --git a/packages/expect/src/jest-expect.ts b/packages/expect/src/jest-expect.ts index 34e1ccf4af1d..0ad8ced8c88b 100644 --- a/packages/expect/src/jest-expect.ts +++ b/packages/expect/src/jest-expect.ts @@ -3,6 +3,7 @@ import { assertTypes, getColors } from '@vitest/utils' import type { Constructable } from '@vitest/utils' import type { EnhancedSpy } from '@vitest/spy' import { isMockFunction } from '@vitest/spy' +import type { Test } from '@vitest/runner' import type { Assertion, ChaiPlugin } from './types' import { arrayBufferEquality, generateToBeMessage, iterableEquality, equals as jestEquals, sparseArrayEquality, subsetEquality, typeEquality } from './jest-utils' import type { AsymmetricMatcher } from './jest-asymmetric-matchers' @@ -637,7 +638,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => { utils.addProperty(chai.Assertion.prototype, 'resolves', function __VITEST_RESOLVES__(this: any) { utils.flag(this, 'promise', 'resolves') utils.flag(this, 'error', new Error('resolves')) - const test = utils.flag(this, 'vitest-test') + const test: Test = utils.flag(this, 'vitest-test') const obj = utils.flag(this, 'object') if (typeof obj?.then !== 'function') @@ -672,7 +673,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => { utils.addProperty(chai.Assertion.prototype, 'rejects', function __VITEST_REJECTS__(this: any) { utils.flag(this, 'promise', 'rejects') utils.flag(this, 'error', new Error('rejects')) - const test = utils.flag(this, 'vitest-test') + const test: Test = utils.flag(this, 'vitest-test') const obj = utils.flag(this, 'object') const wrapper = typeof obj === 'function' ? obj() : obj // for jest compat diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index d29df789c93f..47c5a5b1d8d7 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -1,4 +1,5 @@ import { processError } from '@vitest/utils/error' +import type { Test } from '@vitest/runner/types' import { GLOBAL_EXPECT } from './constants' import { getState } from './state' import type { Assertion, MatcherState } from './types' @@ -24,8 +25,9 @@ export function recordAsyncExpect(test: any, promise: Promise | PromiseLike export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic & Assertion, ...args: any[]) => void) { return function (this: Chai.AssertionStatic & Assertion, ...args: any[]) { - const test = utils.flag(this, 'vitest-test') + const test: Test = utils.flag(this, 'vitest-test') + // @ts-expect-error local is untyped const state: MatcherState = test?.context._local ? test.context.expect.getState() : getState((globalThis as any)[GLOBAL_EXPECT]) @@ -37,9 +39,9 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic return fn.apply(this, args) } catch (err) { - test.result.state = 'fail' - test.result.errors ||= [] - test.result.errors.push(processError(err)) + test.result!.state = 'fail' + test.result!.errors ||= [] + test.result!.errors.push(processError(err)) } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48b4d8ca0303..4313e521bcae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -970,6 +970,9 @@ importers: specifier: ^4.3.7 version: 4.3.7 devDependencies: + '@vitest/expect': + specifier: workspace:* + version: 'link:' picocolors: specifier: ^1.0.0 version: 1.0.0 @@ -15491,7 +15494,7 @@ packages: dependencies: foreground-child: 3.1.1 jackspeak: 2.1.1 - minimatch: 9.0.0 + minimatch: 9.0.1 minipass: 5.0.0 path-scurry: 1.7.0 dev: true From 253ae364e3f46950ea0134006562cf3fd15cd321 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 10:45:40 +0000 Subject: [PATCH 34/39] chore: should be runner --- packages/expect/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/expect/package.json b/packages/expect/package.json index 7cbb30fe3886..7425f8d02c75 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -39,7 +39,7 @@ "chai": "^4.3.7" }, "devDependencies": { - "@vitest/expect": "workspace:*", + "@vitest/runner": "workspace:*", "picocolors": "^1.0.0" } } From b5dad6533c83fcb8a6cbac65317b5bbc58da72ba Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 10:51:50 +0000 Subject: [PATCH 35/39] feat: should throw an error when soft run outside of the test --- packages/expect/src/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index 47c5a5b1d8d7..64c0d6d2fd4c 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -27,12 +27,15 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic return function (this: Chai.AssertionStatic & Assertion, ...args: any[]) { const test: Test = utils.flag(this, 'vitest-test') + if (!test) + throw new Error('expect.soft() can only be used inside a test') + // @ts-expect-error local is untyped const state: MatcherState = test?.context._local ? test.context.expect.getState() : getState((globalThis as any)[GLOBAL_EXPECT]) - if (!test || !state.soft) + if (!state.soft) return fn.apply(this, args) try { From b2d8cdf3aa697d75b8098b9da9fd217f21ce1d90 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 11:02:56 +0000 Subject: [PATCH 36/39] chore: update lock --- pnpm-lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4313e521bcae..4171a25a7d1f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -970,9 +970,9 @@ importers: specifier: ^4.3.7 version: 4.3.7 devDependencies: - '@vitest/expect': + '@vitest/runner': specifier: workspace:* - version: 'link:' + version: link:../runner picocolors: specifier: ^1.0.0 version: 1.0.0 From 7b2c8ce1e1762e89f30387684abcc6d154967f92 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 13:01:56 +0000 Subject: [PATCH 37/39] feat: better handle --- packages/expect/src/utils.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/expect/src/utils.ts b/packages/expect/src/utils.ts index 64c0d6d2fd4c..aa1754d57f78 100644 --- a/packages/expect/src/utils.ts +++ b/packages/expect/src/utils.ts @@ -27,9 +27,6 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic return function (this: Chai.AssertionStatic & Assertion, ...args: any[]) { const test: Test = utils.flag(this, 'vitest-test') - if (!test) - throw new Error('expect.soft() can only be used inside a test') - // @ts-expect-error local is untyped const state: MatcherState = test?.context._local ? test.context.expect.getState() @@ -38,13 +35,17 @@ export function wrapSoft(utils: Chai.ChaiUtils, fn: (this: Chai.AssertionStatic if (!state.soft) return fn.apply(this, args) + if (!test) + throw new Error('expect.soft() can only be used inside a test') + try { return fn.apply(this, args) } catch (err) { - test.result!.state = 'fail' - test.result!.errors ||= [] - test.result!.errors.push(processError(err)) + test.result ||= { state: 'fail' } + test.result.state = 'fail' + test.result.errors ||= [] + test.result.errors.push(processError(err)) } } } From 36a6a4354d9aa5d35a2eb659a0f548a7ca4de3f4 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 14:42:13 +0000 Subject: [PATCH 38/39] test: add failing test --- test/fails/fixtures/expect.test.ts | 4 ++++ test/fails/test/__snapshots__/runner.test.ts.snap | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/fails/fixtures/expect.test.ts b/test/fails/fixtures/expect.test.ts index 5521043f40f3..af8f513b66b8 100644 --- a/test/fails/fixtures/expect.test.ts +++ b/test/fails/fixtures/expect.test.ts @@ -3,3 +3,7 @@ import { expect, test } from 'vitest' test('hi', () => { expect(1 + 1).toEqual(3) }) + +test('hi soft', () => { + expect.soft(1 + 1).toEqual(3) +}) diff --git a/test/fails/test/__snapshots__/runner.test.ts.snap b/test/fails/test/__snapshots__/runner.test.ts.snap index ac8c44666374..93c649aaa8c4 100644 --- a/test/fails/test/__snapshots__/runner.test.ts.snap +++ b/test/fails/test/__snapshots__/runner.test.ts.snap @@ -6,7 +6,10 @@ exports[`should fail each-timeout.test.ts > each-timeout.test.ts 1`] = `"Error: exports[`should fail empty.test.ts > empty.test.ts 1`] = `"Error: No test suite found in file /empty.test.ts"`; -exports[`should fail expect.test.ts > expect.test.ts 1`] = `"AssertionError: expected 2 to deeply equal 3"`; +exports[`should fail expect.test.ts > expect.test.ts 1`] = ` +"AssertionError: expected 2 to deeply equal 3 +AssertionError: expected 2 to deeply equal 3" +`; exports[`should fail hook-timeout.test.ts > hook-timeout.test.ts 1`] = `"Error: Hook timed out in 10ms."`; From 5ea3b91407a5baf72a5c2fa43ad4616c5e344aa0 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Tue, 6 Jun 2023 15:14:04 +0000 Subject: [PATCH 39/39] test: update --- test/fails/fixtures/expect-soft.test.ts | 3 +++ test/fails/fixtures/expect.test.ts | 4 ---- test/fails/test/__snapshots__/runner.test.ts.snap | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 test/fails/fixtures/expect-soft.test.ts diff --git a/test/fails/fixtures/expect-soft.test.ts b/test/fails/fixtures/expect-soft.test.ts new file mode 100644 index 000000000000..2691ad966be0 --- /dev/null +++ b/test/fails/fixtures/expect-soft.test.ts @@ -0,0 +1,3 @@ +import { expect } from 'vitest' + +expect.soft(1 + 1).toEqual(3) diff --git a/test/fails/fixtures/expect.test.ts b/test/fails/fixtures/expect.test.ts index af8f513b66b8..5521043f40f3 100644 --- a/test/fails/fixtures/expect.test.ts +++ b/test/fails/fixtures/expect.test.ts @@ -3,7 +3,3 @@ import { expect, test } from 'vitest' test('hi', () => { expect(1 + 1).toEqual(3) }) - -test('hi soft', () => { - expect.soft(1 + 1).toEqual(3) -}) diff --git a/test/fails/test/__snapshots__/runner.test.ts.snap b/test/fails/test/__snapshots__/runner.test.ts.snap index 93c649aaa8c4..0dca905eb9e7 100644 --- a/test/fails/test/__snapshots__/runner.test.ts.snap +++ b/test/fails/test/__snapshots__/runner.test.ts.snap @@ -6,10 +6,9 @@ exports[`should fail each-timeout.test.ts > each-timeout.test.ts 1`] = `"Error: exports[`should fail empty.test.ts > empty.test.ts 1`] = `"Error: No test suite found in file /empty.test.ts"`; -exports[`should fail expect.test.ts > expect.test.ts 1`] = ` -"AssertionError: expected 2 to deeply equal 3 -AssertionError: expected 2 to deeply equal 3" -`; +exports[`should fail expect.test.ts > expect.test.ts 1`] = `"AssertionError: expected 2 to deeply equal 3"`; + +exports[`should fail expect-soft.test.ts > expect-soft.test.ts 1`] = `"Error: expect.soft() can only be used inside a test"`; exports[`should fail hook-timeout.test.ts > hook-timeout.test.ts 1`] = `"Error: Hook timed out in 10ms."`;