chore(deps): update dependency @antfu/eslint-config to v2 (#5153)

This commit is contained in:
renovate[bot]
2024-02-08 17:33:12 +01:00
committed by GitHub
parent 7f4b782ad1
commit ec0ddc595a
56 changed files with 609 additions and 478 deletions
-2
View File
@@ -22,7 +22,6 @@ Next generation testing framework powered by Vite.
<a href="https://cn.vitest.dev">中文文档</a>
</p>
<h4 align="center">
</h4>
@@ -49,7 +48,6 @@ Next generation testing framework powered by Vite.
> Vitest 1.0 requires Vite >=v5.0.0 and Node >=v18.0.0
```ts
import { assert, describe, expect, it } from 'vitest'
+16 -16
View File
@@ -11,69 +11,69 @@ export interface VitestRunner {
/**
* First thing that's getting called before actually collecting and running tests.
*/
onBeforeCollect?(paths: string[]): unknown
onBeforeCollect?: (paths: string[]) => unknown
/**
* Called after collecting tests and before "onBeforeRun".
*/
onCollected?(files: File[]): unknown
onCollected?: (files: File[]) => unknown
/**
* Called when test runner should cancel next test runs.
* Runner should listen for this method and mark tests and suites as skipped in
* "onBeforeRunSuite" and "onBeforeRunTask" when called.
*/
onCancel?(reason: CancelReason): unknown
onCancel?: (reason: CancelReason) => unknown
/**
* Called before running a single test. Doesn't have "result" yet.
*/
onBeforeRunTask?(test: TaskPopulated): unknown
onBeforeRunTask?: (test: TaskPopulated) => unknown
/**
* Called before actually running the test function. Already has "result" with "state" and "startTime".
*/
onBeforeTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
onBeforeTryTask?: (test: TaskPopulated, options: { retry: number; repeats: number }) => unknown
/**
* Called after result and state are set.
*/
onAfterRunTask?(test: TaskPopulated): unknown
onAfterRunTask?: (test: TaskPopulated) => unknown
/**
* Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
*/
onAfterTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
onAfterTryTask?: (test: TaskPopulated, options: { retry: number; repeats: number }) => unknown
/**
* Called before running a single suite. Doesn't have "result" yet.
*/
onBeforeRunSuite?(suite: Suite): unknown
onBeforeRunSuite?: (suite: Suite) => unknown
/**
* Called after running a single suite. Has state and result.
*/
onAfterRunSuite?(suite: Suite): unknown
onAfterRunSuite?: (suite: Suite) => unknown
/**
* If defined, will be called instead of usual Vitest suite partition and handling.
* "before" and "after" hooks will not be ignored.
*/
runSuite?(suite: Suite): Promise<void>
runSuite?: (suite: Suite) => Promise<void>
/**
* If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
* "before" and "after" hooks will not be ignored.
*/
runTask?(test: TaskPopulated): Promise<void>
runTask?: (test: TaskPopulated) => Promise<void>
/**
* Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
*/
onTaskUpdate?(task: [string, TaskResult | undefined][]): Promise<void>
onTaskUpdate?: (task: [string, TaskResult | undefined][]) => Promise<void>
/**
* Called before running all tests in collected paths.
*/
onBeforeRunFiles?(files: File[]): unknown
onBeforeRunFiles?: (files: File[]) => unknown
/**
* Called right after running all tests in collected paths.
*/
onAfterRunFiles?(files: File[]): unknown
onAfterRunFiles?: (files: File[]) => unknown
/**
* Called when new context for a test is defined. Useful, if you want to add custom properties to the context.
* If you only want to define custom context with a runner, consider using "beforeAll" in "setupFiles" instead.
@@ -82,11 +82,11 @@ export interface VitestRunner {
*
* @see https://vitest.dev/advanced/runner.html#your-task-function
*/
extendTaskContext?<T extends Test | Custom>(context: TaskContext<T>): TaskContext<T>
extendTaskContext?: <T extends Test | Custom>(context: TaskContext<T>) => TaskContext<T>
/**
* Called, when certain files are imported. Can be called in two situations: when collecting tests and when importing setup files.
*/
importFile(filepath: string, source: VitestRunnerImportSource): unknown
importFile: (filepath: string, source: VitestRunnerImportSource) => unknown
/**
* Publicly available configuration.
*/
+2 -2
View File
@@ -1389,7 +1389,7 @@ If you are using TypeScript, since Vitest 0.31.0 you can extend default `Asserti
```ts
interface CustomMatchers<R = unknown> {
toBeFoo(): R
toBeFoo: () => R
}
declare module 'vitest' {
@@ -1456,4 +1456,4 @@ expect.addEqualityTesters([areAnagramsEqual])
test('custom equality tester', () => {
expect(new AnagramComparator('listen')).toEqual(new AnagramComparator('silent'))
})
```
```
-1
View File
@@ -209,7 +209,6 @@ test.todo.concurrent(/* ... */) // or test.concurrent.todo(/* ... */)
When running concurrent tests, Snapshots and Assertions must use `expect` from the local [Test Context](/guide/test-context.md) to ensure the right test is detected.
```ts
test.concurrent('test 1', async ({ expect }) => {
expect(foo).toMatchSnapshot()
+4 -8
View File
@@ -702,7 +702,6 @@ Minimum number of threads. You can also use `VITEST_MIN_THREADS` environment var
Run all tests with the same environment inside a single worker thread. This will disable built-in module isolation (your source code or [inlined](#deps-inline) code will still be reevaluated for each test), but can improve test performance.
:::warning
Even though this option will force tests to run one after another, this option is different from Jest's `--runInBand`. Vitest uses workers not only for running tests in parallel, but also to provide isolation. By disabling this option, your tests will run sequentially, but in the same global context, so you must provide isolation yourself.
@@ -782,7 +781,6 @@ Isolate environment for each test file.
Run all tests with the same environment inside a single child process. This will disable built-in module isolation (your source code or [inlined](#deps-inline) code will still be reevaluated for each test), but can improve test performance.
:::warning
Even though this option will force tests to run one after another, this option is different from Jest's `--runInBand`. Vitest uses child processes not only for running tests in parallel, but also to provide isolation. By disabling this option, your tests will run sequentially, but in the same global context, so you must provide isolation yourself.
@@ -881,7 +879,6 @@ Pass additional arguments to `node` process in the VM context. See [Command-line
Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103.
:::
#### poolOptions.vmForks<NonProjectOption />
Options for `vmForks` pool.
@@ -1063,7 +1060,6 @@ declare module 'vitest' {
```
:::
### watchExclude<NonProjectOption />
- **Type:** `string[]`
@@ -1557,10 +1553,10 @@ Path to a provider that will be used when running browser tests. Vitest provides
```ts
export interface BrowserProvider {
name: string
getSupportedBrowsers(): readonly string[]
initialize(ctx: Vitest, options: { browser: string; options?: BrowserProviderOptions }): Awaitable<void>
openPage(url: string): Awaitable<void>
close(): Awaitable<void>
getSupportedBrowsers: () => readonly string[]
initialize: (ctx: Vitest, options: { browser: string; options?: BrowserProviderOptions }) => Awaitable<void>
openPage: (url: string) => Awaitable<void>
close: () => Awaitable<void>
}
```
+1 -1
View File
@@ -29,7 +29,7 @@ If you are using TypeScript, since Vitest 0.31.0 you can extend default `Asserti
import type { Assertion, AsymmetricMatchersContaining } from 'vitest'
interface CustomMatchers<R = unknown> {
toBeFoo(): R
toBeFoo: () => R
}
declare module 'vitest' {
+1 -1
View File
@@ -22,7 +22,7 @@ basic-foo.test.ts
basic/foo.test.ts
```
You can also use the `-t, --testNamePattern <pattern> ` option to filter tests by full name. This can be helpful when you want to filter by the name defined within a file rather than the filename itself.
You can also use the `-t, --testNamePattern <pattern>` option to filter tests by full name. This can be helpful when you want to filter by the name defined within a file rather than the filename itself.
## Specifying a Timeout
-3
View File
@@ -19,7 +19,6 @@ All `@vitest/*` sub packages require Vitest version 1.0.
Quotes in snapshots are no longer escaped, and all snapshots use backtick quotes (`) even if the string is just a single line.
1. Quotes are no longer escaped:
```diff
@@ -44,7 +43,6 @@ There were also [changes](https://github.com/vitest-dev/vitest/pull/4076) to `@v
- `client.setTest` was renamed to `client.startCurrentRun`
- `client.resetCurrent` was renamed to `client.finishCurrentRun`
### Pools are Standardized [#4172](https://github.com/vitest-dev/vitest/pull/4172)
We removed a lot of configuration options to make it easier to configure the runner to your needs. Please, have a look at migration examples if you rely on `--threads` or other related flags.
@@ -145,7 +143,6 @@ A few types were removed in favor of Jest-style "Mock" naming.
`SpyInstance` is deprecated in favor of `MockInstance` and will be removed in the next major release.
:::
### Timer mocks [#3925](https://github.com/vitest-dev/vitest/pull/3925)
`vi.useFakeTimers()` no longer automatically mocks [`process.nextTick`](https://nodejs.org/api/process.html#processnexttickcallback-args).
-1
View File
@@ -362,7 +362,6 @@ Because Vitest runs in Node, mocking network requests is tricky; web APIs are no
Mock Service Worker (MSW) works by intercepting the requests your tests make, allowing you to use it without changing any of your application code. In-browser, this uses the [Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API). In Node.js, and for Vitest, it uses the [`@mswjs/interceptors`](https://github.com/mswjs/interceptors) library. To learn more about MSW, read their [introduction](https://mswjs.io/docs/)
### Configuration
You can use it like below in your [setup file](/config/#setupfiles)
-3
View File
@@ -426,7 +426,6 @@ not ok 1 - __tests__/test-file-1.test.ts > first test file > 2 + 2 should equal
ok 2 - __tests__/test-file-1.test.ts > first test file > 4 - 2 should equal 2 # time=0.00ms
```
### Hanging Process Reporter
Displays a list of hanging processes, if any are preventing Vitest from exiting safely. The `hanging-process` reporter does not itself display test results, but can be used in conjunction with another reporter to monitor processes while tests run. Using this reporter can be resource-intensive, so should generally be reserved for debugging purposes in situations where Vitest consistently cannot exit the process.
@@ -453,8 +452,6 @@ to provide annotations for test failures. This reporter is automatically enabled
<img alt="Github Actions" img-dark src="https://github.com/vitest-dev/vitest/assets/4232207/336cddc2-df6b-4b8a-8e72-4d00010e37f5">
<img alt="Github Actions" img-light src="https://github.com/vitest-dev/vitest/assets/4232207/ce8447c1-0eab-4fe1-abef-d0d322290dca">
## Custom Reporters
You can use third-party custom reporters installed from NPM by specifying their package name in the reporters' option:
-1
View File
@@ -159,7 +159,6 @@ export default {
} satisfies SnapshotSerializer
```
```ts
import { defineConfig } from 'vite'
-1
View File
@@ -18,7 +18,6 @@ vitest --ui
Then you can visit the Vitest UI at <a href="http://localhost:51204/__vitest__/">`http://localhost:51204/__vitest__/`</a>
<img alt="Vitest UI" img-light src="https://user-images.githubusercontent.com/11247099/171992267-5cae2fa0-b927-400a-8eb1-da776974cb61.png">
<img alt="Vitest UI" img-dark src="https://user-images.githubusercontent.com/11247099/171992272-7c6057e2-80c3-4b17-a7b6-0ac28e5a5e0b.png">
+13 -1
View File
@@ -24,8 +24,14 @@ export default antfu(
'node/prefer-global/process': 'off',
'no-empty-pattern': 'off',
'antfu/indent-binary-ops': 'off',
'style/member-delimiter-style': ['error', { multiline: { delimiter: 'none' }, singleline: { delimiter: 'semi' } }],
'unused-imports/no-unused-imports': 'error',
'style/member-delimiter-style': [
'error',
{
multiline: { delimiter: 'none' },
singleline: { delimiter: 'semi' },
},
],
'ts/no-invalid-this': 'off',
@@ -42,6 +48,12 @@ export default antfu(
'import/no-named-as-default': 'off',
},
},
{
files: [`packages/*/*.{js,mjs,d.ts}`],
rules: {
'antfu/no-import-dist': 'off',
},
},
{
files: [`packages/${GLOB_SRC}`],
rules: {
+1 -1
View File
@@ -4,7 +4,7 @@ import { toMatchImageSnapshot } from 'jest-image-snapshot'
declare module 'vitest' {
interface Assertion<T> {
toMatchImageSnapshot(): T
toMatchImageSnapshot: () => T
}
}
+15 -14
View File
@@ -1,19 +1,20 @@
[build.environment]
NODE_VERSION = "20"
# don't need playwright for docs build
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
[build]
publish = "docs/.vitepress/dist"
command = "pnpm docs:build"
ignore = "git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
publish = "docs/.vitepress/dist"
command = "pnpm docs:build"
ignore = "git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
[build.environment]
NODE_VERSION = "20"
# don't need playwright for docs build
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
[[redirects]]
from = "/new"
to = "https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/"
status = 302
from = "/new"
to = "https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/"
status = 302
[[headers]]
for = "/manifest.webmanifest"
[headers.values]
Content-Type = "application/manifest+json"
for = "/manifest.webmanifest"
[headers.values]
Content-Type = "application/manifest+json"
+1 -1
View File
@@ -38,7 +38,7 @@
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
},
"devDependencies": {
"@antfu/eslint-config": "^1.2.1",
"@antfu/eslint-config": "^2.6.4",
"@antfu/ni": "^0.21.12",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
+2 -2
View File
@@ -55,13 +55,13 @@
"webdriverio": "*"
},
"peerDependenciesMeta": {
"webdriverio": {
"playwright": {
"optional": true
},
"safaridriver": {
"optional": true
},
"playwright": {
"webdriverio": {
"optional": true
}
},
+8 -8
View File
@@ -1,4 +1,4 @@
import type { File, TaskResultPack, Test, VitestRunner } from '@vitest/runner'
import type { File, Task, TaskResultPack, VitestRunner } from '@vitest/runner'
import type { ResolvedConfig } from 'vitest'
import type { VitestExecutor } from 'vitest/execute'
import { rpc } from './rpc'
@@ -16,10 +16,10 @@ interface CoverageHandler {
}
export function createBrowserRunner(
VitestRunner: { new(config: ResolvedConfig): VitestRunner },
runnerClass: { new(config: ResolvedConfig): VitestRunner },
coverageModule: CoverageHandler | null,
): { new(options: BrowserRunnerOptions): VitestRunner } {
return class BrowserTestRunner extends VitestRunner {
return class BrowserTestRunner extends runnerClass implements VitestRunner {
public config: ResolvedConfig
hashMap = browserHashMap
@@ -28,7 +28,7 @@ export function createBrowserRunner(
this.config = options.config
}
async onAfterRunTask(task: Test) {
onAfterRunTask = async (task: Task) => {
await super.onAfterRunTask?.(task)
if (this.config.bail && task.result?.state === 'fail') {
@@ -42,7 +42,7 @@ export function createBrowserRunner(
}
}
async onAfterRunFiles(files: File[]) {
onAfterRunFiles = async (files: File[]) => {
await super.onAfterRunFiles?.(files)
const coverage = await coverageModule?.takeCoverage?.()
@@ -55,15 +55,15 @@ export function createBrowserRunner(
}
}
onCollected(files: File[]): unknown {
onCollected = (files: File[]): unknown => {
return rpc().onCollected(files)
}
onTaskUpdate(task: TaskResultPack[]): Promise<void> {
onTaskUpdate = (task: TaskResultPack[]): Promise<void> => {
return rpc().onTaskUpdate(task)
}
async importFile(filepath: string) {
importFile = async (filepath: string) => {
let [test, hash] = this.hashMap.get(filepath) ?? [false, '']
if (hash === '') {
hash = Date.now().toString()
+3 -3
View File
@@ -14,9 +14,9 @@ interface BrowserRunnerState {
runningFiles: string[]
moduleCache: WorkerGlobalState['moduleCache']
config: ResolvedConfig
exportAll(): void
wrapModule(module: any): any
runTests(tests: string[]): Promise<void>
exportAll: () => void
wrapModule: (module: any) => any
runTests: (tests: string[]) => Promise<void>
}
export function getBrowserState(): BrowserRunnerState {
+2 -2
View File
@@ -32,8 +32,8 @@ interface TestExclude {
excludeNodeModules?: boolean
relativePath?: boolean
}): {
shouldInstrument(filePath: string): boolean
glob(cwd: string): Promise<string[]>
shouldInstrument: (filePath: string) => boolean
glob: (cwd: string) => Promise<string[]>
}
}
+2 -2
View File
@@ -35,8 +35,8 @@ interface TestExclude {
excludeNodeModules?: boolean
relativePath?: boolean
}): {
shouldInstrument(filePath: string): boolean
glob(cwd: string): Promise<string[]>
shouldInstrument: (filePath: string) => boolean
glob: (cwd: string) => Promise<string[]>
}
}
@@ -6,10 +6,10 @@ import { diff, getCustomEqualityTesters, getMatcherUtils, stringify } from './je
import { equals, isA, iterableEquality, pluralize, subsetEquality } from './jest-utils'
export interface AsymmetricMatcherInterface {
asymmetricMatch(other: unknown): boolean
toString(): string
getExpectedType?(): string
toAsymmetricMatcher?(): string
asymmetricMatch: (other: unknown) => boolean
toString: () => string
getExpectedType?: () => string
toAsymmetricMatcher?: () => string
}
export abstract class AsymmetricMatcher<
+61 -61
View File
@@ -91,72 +91,72 @@ export type MatchersObject<T extends MatcherState = MatcherState> = Record<strin
export interface ExpectStatic extends Chai.ExpectStatic, AsymmetricMatchersContaining {
<T>(actual: T, message?: string): Assertion<T>
unreachable(message?: string): never
soft<T>(actual: T, message?: string): Assertion<T>
extend(expects: MatchersObject): void
addEqualityTesters(testers: Array<Tester>): void
assertions(expected: number): void
hasAssertions(): void
anything(): any
any(constructor: unknown): any
getState(): MatcherState
setState(state: Partial<MatcherState>): void
unreachable: (message?: string) => never
soft: <T>(actual: T, message?: string) => Assertion<T>
extend: (expects: MatchersObject) => void
addEqualityTesters: (testers: Array<Tester>) => void
assertions: (expected: number) => void
hasAssertions: () => void
anything: () => any
any: (constructor: unknown) => any
getState: () => MatcherState
setState: (state: Partial<MatcherState>) => void
not: AsymmetricMatchersContaining
}
export interface AsymmetricMatchersContaining {
stringContaining(expected: string): any
objectContaining<T = any>(expected: T): any
arrayContaining<T = unknown>(expected: Array<T>): any
stringMatching(expected: string | RegExp): any
closeTo(expected: number, precision?: number): any
stringContaining: (expected: string) => any
objectContaining: <T = any>(expected: T) => any
arrayContaining: <T = unknown>(expected: Array<T>) => any
stringMatching: (expected: string | RegExp) => any
closeTo: (expected: number, precision?: number) => any
}
export interface JestAssertion<T = any> extends jest.Matchers<void, T> {
// Jest compact
toEqual<E>(expected: E): void
toStrictEqual<E>(expected: E): void
toBe<E>(expected: E): void
toMatch(expected: string | RegExp): void
toMatchObject<E extends {} | any[]>(expected: E): void
toContain<E>(item: E): void
toContainEqual<E>(item: E): void
toBeTruthy(): void
toBeFalsy(): void
toBeGreaterThan(num: number | bigint): void
toBeGreaterThanOrEqual(num: number | bigint): void
toBeLessThan(num: number | bigint): void
toBeLessThanOrEqual(num: number | bigint): void
toBeNaN(): void
toBeUndefined(): void
toBeNull(): void
toBeDefined(): void
toBeInstanceOf<E>(expected: E): void
toBeCalledTimes(times: number): void
toHaveLength(length: number): void
toHaveProperty<E>(property: string | (string | number)[], value?: E): void
toBeCloseTo(number: number, numDigits?: number): void
toHaveBeenCalledTimes(times: number): void
toHaveBeenCalled(): void
toBeCalled(): void
toHaveBeenCalledWith<E extends any[]>(...args: E): void
toBeCalledWith<E extends any[]>(...args: E): void
toHaveBeenNthCalledWith<E extends any[]>(n: number, ...args: E): void
nthCalledWith<E extends any[]>(nthCall: number, ...args: E): void
toHaveBeenLastCalledWith<E extends any[]>(...args: E): void
lastCalledWith<E extends any[]>(...args: E): void
toThrow(expected?: string | Constructable | RegExp | Error): void
toThrowError(expected?: string | Constructable | RegExp | Error): void
toReturn(): void
toHaveReturned(): void
toReturnTimes(times: number): void
toHaveReturnedTimes(times: number): void
toReturnWith<E>(value: E): void
toHaveReturnedWith<E>(value: E): void
toHaveLastReturnedWith<E>(value: E): void
lastReturnedWith<E>(value: E): void
toHaveNthReturnedWith<E>(nthCall: number, value: E): void
nthReturnedWith<E>(nthCall: number, value: E): void
toEqual: <E>(expected: E) => void
toStrictEqual: <E>(expected: E) => void
toBe: <E>(expected: E) => void
toMatch: (expected: string | RegExp) => void
toMatchObject: <E extends {} | any[]>(expected: E) => void
toContain: <E>(item: E) => void
toContainEqual: <E>(item: E) => void
toBeTruthy: () => void
toBeFalsy: () => void
toBeGreaterThan: (num: number | bigint) => void
toBeGreaterThanOrEqual: (num: number | bigint) => void
toBeLessThan: (num: number | bigint) => void
toBeLessThanOrEqual: (num: number | bigint) => void
toBeNaN: () => void
toBeUndefined: () => void
toBeNull: () => void
toBeDefined: () => void
toBeInstanceOf: <E>(expected: E) => void
toBeCalledTimes: (times: number) => void
toHaveLength: (length: number) => void
toHaveProperty: <E>(property: string | (string | number)[], value?: E) => void
toBeCloseTo: (number: number, numDigits?: number) => void
toHaveBeenCalledTimes: (times: number) => void
toHaveBeenCalled: () => void
toBeCalled: () => void
toHaveBeenCalledWith: <E extends any[]>(...args: E) => void
toBeCalledWith: <E extends any[]>(...args: E) => void
toHaveBeenNthCalledWith: <E extends any[]>(n: number, ...args: E) => void
nthCalledWith: <E extends any[]>(nthCall: number, ...args: E) => void
toHaveBeenLastCalledWith: <E extends any[]>(...args: E) => void
lastCalledWith: <E extends any[]>(...args: E) => void
toThrow: (expected?: string | Constructable | RegExp | Error) => void
toThrowError: (expected?: string | Constructable | RegExp | Error) => void
toReturn: () => void
toHaveReturned: () => void
toReturnTimes: (times: number) => void
toHaveReturnedTimes: (times: number) => void
toReturnWith: <E>(value: E) => void
toHaveReturnedWith: <E>(value: E) => void
toHaveLastReturnedWith: <E>(value: E) => void
lastReturnedWith: <E>(value: E) => void
toHaveNthReturnedWith: <E>(nthCall: number, value: E) => void
nthReturnedWith: <E>(nthCall: number, value: E) => void
}
type VitestAssertion<A, T> = {
@@ -176,9 +176,9 @@ type Promisify<O> = {
}
export interface Assertion<T = any> extends VitestAssertion<Chai.Assertion, T>, JestAssertion<T> {
toBeTypeOf(expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined'): void
toHaveBeenCalledOnce(): void
toSatisfy<E>(matcher: (value: E) => boolean, message?: string): void
toBeTypeOf: (expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined') => void
toHaveBeenCalledOnce: () => void
toSatisfy: <E>(matcher: (value: E) => boolean, message?: string) => void
resolves: Promisify<Assertion<T>>
rejects: Promisify<Assertion<T>>
+37 -18
View File
@@ -1,5 +1,16 @@
import type { DiffOptions } from '@vitest/utils/diff'
import type { Custom, ExtendedContext, File, SequenceHooks, SequenceSetupFiles, Suite, TaskContext, TaskPopulated, TaskResultPack, Test } from './tasks'
import type {
Custom,
ExtendedContext,
File,
SequenceHooks,
SequenceSetupFiles,
Suite,
Task,
TaskContext,
TaskResultPack,
Test,
} from './tasks'
export interface VitestRunnerConfig {
root: string
@@ -31,75 +42,81 @@ export interface VitestRunnerConstructor {
new(config: VitestRunnerConfig): VitestRunner
}
export type CancelReason = 'keyboard-input' | 'test-failure' | string & Record<string, never>
export type CancelReason =
| 'keyboard-input'
| 'test-failure'
| string & Record<string, never>
export interface VitestRunner {
/**
* First thing that's getting called before actually collecting and running tests.
*/
onBeforeCollect?(paths: string[]): unknown
onBeforeCollect?: (paths: string[]) => unknown
/**
* Called after collecting tests and before "onBeforeRun".
*/
onCollected?(files: File[]): unknown
onCollected?: (files: File[]) => unknown
/**
* Called when test runner should cancel next test runs.
* Runner should listen for this method and mark tests and suites as skipped in
* "onBeforeRunSuite" and "onBeforeRunTask" when called.
*/
onCancel?(reason: CancelReason): unknown
onCancel?: (reason: CancelReason) => unknown
/**
* Called before running a single test. Doesn't have "result" yet.
*/
onBeforeRunTask?(test: TaskPopulated): unknown
onBeforeRunTask?: (test: Task) => unknown
/**
* Called before actually running the test function. Already has "result" with "state" and "startTime".
*/
onBeforeTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
onBeforeTryTask?: (test: Task, options: { retry: number; repeats: number }) => unknown
/**
* Called after result and state are set.
*/
onAfterRunTask?(test: TaskPopulated): unknown
onAfterRunTask?: (test: Task) => unknown
/**
* Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
*/
onAfterTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
onAfterTryTask?: (
test: Task,
options: { retry: number; repeats: number }
) => unknown
/**
* Called before running a single suite. Doesn't have "result" yet.
*/
onBeforeRunSuite?(suite: Suite): unknown
onBeforeRunSuite?: (suite: Suite) => unknown
/**
* Called after running a single suite. Has state and result.
*/
onAfterRunSuite?(suite: Suite): unknown
onAfterRunSuite?: (suite: Suite) => unknown
/**
* If defined, will be called instead of usual Vitest suite partition and handling.
* "before" and "after" hooks will not be ignored.
*/
runSuite?(suite: Suite): Promise<void>
runSuite?: (suite: Suite) => Promise<void>
/**
* If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
* "before" and "after" hooks will not be ignored.
*/
runTask?(test: TaskPopulated): Promise<void>
runTask?: (test: Task) => Promise<void>
/**
* Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
*/
onTaskUpdate?(task: TaskResultPack[]): Promise<void>
onTaskUpdate?: (task: TaskResultPack[]) => Promise<void>
/**
* Called before running all tests in collected paths.
*/
onBeforeRunFiles?(files: File[]): unknown
onBeforeRunFiles?: (files: File[]) => unknown
/**
* Called right after running all tests in collected paths.
*/
onAfterRunFiles?(files: File[]): unknown
onAfterRunFiles?: (files: File[]) => unknown
/**
* Called when new context for a test is defined. Useful, if you want to add custom properties to the context.
* If you only want to define custom context, consider using "beforeAll" in "setupFiles" instead.
@@ -108,11 +125,13 @@ export interface VitestRunner {
*
* @see https://vitest.dev/advanced/runner.html#your-task-function
*/
extendTaskContext?<T extends Test | Custom>(context: TaskContext<T>): ExtendedContext<T>
extendTaskContext?: <T extends Test | Custom>(
context: TaskContext<T>
) => ExtendedContext<T>
/**
* Called, when files are imported. Can be called in two situations: when collecting tests and when importing setup files.
*/
importFile(filepath: string, source: VitestRunnerImportSource): unknown
importFile: (filepath: string, source: VitestRunnerImportSource) => unknown
/**
* Publicly available configuration.
*/
+6 -6
View File
@@ -193,19 +193,19 @@ export interface TestOptions {
interface ExtendedAPI<ExtraContext> {
each: TestEachFunction
skipIf(condition: any): ChainableTestAPI<ExtraContext>
runIf(condition: any): ChainableTestAPI<ExtraContext>
skipIf: (condition: any) => ChainableTestAPI<ExtraContext>
runIf: (condition: any) => ChainableTestAPI<ExtraContext>
}
export type CustomAPI<ExtraContext = {}> = ChainableTestAPI<ExtraContext> & ExtendedAPI<ExtraContext> & {
extend<T extends Record<string, any> = {}>(fixtures: Fixtures<T, ExtraContext>): CustomAPI<{
extend: <T extends Record<string, any> = {}>(fixtures: Fixtures<T, ExtraContext>) => CustomAPI<{
[K in keyof T | keyof ExtraContext]:
K extends keyof T ? T[K] :
K extends keyof ExtraContext ? ExtraContext[K] : never }>
}
export type TestAPI<ExtraContext = {}> = ChainableTestAPI<ExtraContext> & ExtendedAPI<ExtraContext> & {
extend<T extends Record<string, any> = {}>(fixtures: Fixtures<T, ExtraContext>): TestAPI<{
extend: <T extends Record<string, any> = {}>(fixtures: Fixtures<T, ExtraContext>) => TestAPI<{
[K in keyof T | keyof ExtraContext]:
K extends keyof T ? T[K] :
K extends keyof ExtraContext ? ExtraContext[K] : never }>
@@ -236,8 +236,8 @@ type ChainableSuiteAPI<ExtraContext = {}> = ChainableFunction<
export type SuiteAPI<ExtraContext = {}> = ChainableSuiteAPI<ExtraContext> & {
each: SuiteEachFunction
skipIf(condition: any): ChainableSuiteAPI<ExtraContext>
runIf(condition: any): ChainableSuiteAPI<ExtraContext>
skipIf: (condition: any) => ChainableSuiteAPI<ExtraContext>
runIf: (condition: any) => ChainableSuiteAPI<ExtraContext>
}
export type HookListener<T extends any[], Return = void> = (...args: T) => Awaitable<Return>
+1 -1
View File
@@ -76,4 +76,4 @@ manager.add(result)
// and then read the summary
console.log(manager.summary)
```
```
+7 -7
View File
@@ -1,11 +1,11 @@
export interface SnapshotEnvironment {
getVersion(): string
getHeader(): string
resolvePath(filepath: string): Promise<string>
resolveRawPath(testPath: string, rawPath: string): Promise<string>
saveSnapshotFile(filepath: string, snapshot: string): Promise<void>
readSnapshotFile(filepath: string): Promise<string | null>
removeSnapshotFile(filepath: string): Promise<void>
getVersion: () => string
getHeader: () => string
resolvePath: (filepath: string) => Promise<string>
resolveRawPath: (testPath: string, rawPath: string) => Promise<string>
saveSnapshotFile: (filepath: string, snapshot: string) => Promise<void>
readSnapshotFile: (filepath: string) => Promise<string | null>
removeSnapshotFile: (filepath: string) => Promise<void>
}
export interface SnapshotEnvironmentOptions {
+16 -16
View File
@@ -113,11 +113,11 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
/**
* Use it to return the name given to mock with method `.mockName(name)`.
*/
getMockName(): string
getMockName: () => string
/**
* Sets internal mock name. Useful to see the name of the mock if an assertion fails.
*/
mockName(n: string): this
mockName: (n: string) => this
/**
* Current context of the mock. It stores information about all invocation calls, instances, and results.
*/
@@ -127,19 +127,19 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
*
* It is useful if you need to clean up mock between different assertions.
*/
mockClear(): this
mockClear: () => this
/**
* Does what `mockClear` does and makes inner implementation an empty function (returning `undefined` when invoked). This also resets all "once" implementations.
*
* This is useful when you want to completely reset a mock to the default state.
*/
mockReset(): this
mockReset: () => this
/**
* Does what `mockReset` does and restores inner implementation to the original function.
*
* Note that restoring mock from `vi.fn()` will set implementation to an empty function that returns `undefined`. Restoring a `vi.fn(impl)` will restore implementation to `impl`.
*/
mockRestore(): void
mockRestore: () => void
/**
* Returns current mock implementation if there is one.
*
@@ -147,14 +147,14 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
*
* If mock was created with `vi.spyOn`, it will return `undefined` unless a custom implementation was provided.
*/
getMockImplementation(): ((...args: TArgs) => TReturns) | undefined
getMockImplementation: () => ((...args: TArgs) => TReturns) | undefined
/**
* Accepts a function that will be used as an implementation of the mock.
* @example
* const increment = vi.fn().mockImplementation(count => count + 1);
* expect(increment(3)).toBe(4);
*/
mockImplementation(fn: ((...args: TArgs) => TReturns)): this
mockImplementation: (fn: ((...args: TArgs) => TReturns)) => this
/**
* Accepts a function that will be used as a mock implementation during the next call. Can be chained so that multiple function calls produce different results.
* @example
@@ -162,7 +162,7 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
* expect(fn(3)).toBe(4);
* expect(fn(3)).toBe(3);
*/
mockImplementationOnce(fn: ((...args: TArgs) => TReturns)): this
mockImplementationOnce: (fn: ((...args: TArgs) => TReturns)) => this
/**
* Overrides the original mock implementation temporarily while the callback is being executed.
* @example
@@ -174,15 +174,15 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
*
* myMockFn() // 'original'
*/
withImplementation<T>(fn: ((...args: TArgs) => TReturns), cb: () => T): T extends Promise<unknown> ? Promise<this> : this
withImplementation: <T>(fn: ((...args: TArgs) => TReturns), cb: () => T) => T extends Promise<unknown> ? Promise<this> : this
/**
* Use this if you need to return `this` context from the method without invoking actual implementation.
*/
mockReturnThis(): this
mockReturnThis: () => this
/**
* Accepts a value that will be returned whenever the mock function is called.
*/
mockReturnValue(obj: TReturns): this
mockReturnValue: (obj: TReturns) => this
/**
* Accepts a value that will be returned during the next function call. If chained, every consecutive call will return the specified value.
*
@@ -197,14 +197,14 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
* // 'first call', 'second call', 'default'
* console.log(myMockFn(), myMockFn(), myMockFn())
*/
mockReturnValueOnce(obj: TReturns): this
mockReturnValueOnce: (obj: TReturns) => this
/**
* Accepts a value that will be resolved when async function is called.
* @example
* const asyncMock = vi.fn().mockResolvedValue(42)
* asyncMock() // Promise<42>
*/
mockResolvedValue(obj: Awaited<TReturns>): this
mockResolvedValue: (obj: Awaited<TReturns>) => this
/**
* Accepts a value that will be resolved during the next function call. If chained, every consecutive call will resolve specified value.
* @example
@@ -217,14 +217,14 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
* // Promise<'first call'>, Promise<'second call'>, Promise<'default'>
* console.log(myMockFn(), myMockFn(), myMockFn())
*/
mockResolvedValueOnce(obj: Awaited<TReturns>): this
mockResolvedValueOnce: (obj: Awaited<TReturns>) => this
/**
* Accepts an error that will be rejected when async function is called.
* @example
* const asyncMock = vi.fn().mockRejectedValue(new Error('Async error'))
* await asyncMock() // throws 'Async error'
*/
mockRejectedValue(obj: any): this
mockRejectedValue: (obj: any) => this
/**
* Accepts a value that will be rejected during the next function call. If chained, every consecutive call will reject specified value.
* @example
@@ -236,7 +236,7 @@ export interface MockInstance<TArgs extends any[] = any[], TReturns = any> {
* await asyncMock() // first call
* await asyncMock() // throws "Async error"
*/
mockRejectedValueOnce(obj: any): this
mockRejectedValueOnce: (obj: any) => this
}
export interface Mock<TArgs extends any[] = any, TReturns = any> extends MockInstance<TArgs, TReturns> {
+1 -1
View File
@@ -28,7 +28,7 @@ declare global {
/**
* Install all vue plugins and globals then mount
*/
mount<Props = any>(comp: Component<Props>, options?: unknown): Cypress.Chainable<any>
mount: <Props = any>(comp: Component<Props>, options?: unknown) => Cypress.Chainable<any>
}
}
}
+4 -5
View File
@@ -4,10 +4,9 @@ import type { HMRPayload, Plugin } from 'vite'
export type EventType = string | symbol
export type Handler<T = unknown> = (event: T) => void
export interface Emitter<Events extends Record<EventType, unknown>> {
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void
on: <Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>) => void
off: <Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>) => void
emit: (<Key extends keyof Events>(type: Key, event: Events[Key]) => void) & (<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never) => void)
}
export type HMREmitter = Emitter<{
@@ -22,7 +21,7 @@ declare module 'vite' {
export function createHmrEmitter(): HMREmitter {
const emitter = new EventEmitter()
return emitter
return emitter as HMREmitter
}
export function viteNodeHmrPlugin(): Plugin {
+1 -1
View File
@@ -225,7 +225,7 @@ function mapEvalOrigin(origin: string): string {
}
interface CallSite extends NodeJS.CallSite {
getScriptNameOrSourceURL(): string
getScriptNameOrSourceURL: () => string
}
// This is copied almost verbatim from the V8 source code at
+5 -5
View File
@@ -121,13 +121,16 @@
"jsdom": "*"
},
"peerDependenciesMeta": {
"@edge-runtime/vm": {
"optional": true
},
"@types/node": {
"optional": true
},
"@vitest/ui": {
"@vitest/browser": {
"optional": true
},
"@vitest/browser": {
"@vitest/ui": {
"optional": true
},
"happy-dom": {
@@ -135,9 +138,6 @@
},
"jsdom": {
"optional": true
},
"@edge-runtime/vm": {
"optional": true
}
},
"dependencies": {
+28 -28
View File
@@ -7,36 +7,36 @@ export interface TransformResultWithSource extends TransformResult {
}
export interface WebSocketHandlers {
onUnhandledError(error: unknown, type: string): Promise<void>
onCollected(files?: File[]): Promise<void>
onTaskUpdate(packs: TaskResultPack[]): void
onAfterSuiteRun(meta: AfterSuiteRunMeta): void
onCancel(reason: CancelReason): void
getCountOfFailedTests(): number
sendLog(log: UserConsoleLog): void
getFiles(): File[]
getPaths(): string[]
getConfig(): ResolvedConfig
resolveSnapshotPath(testPath: string): string
resolveSnapshotRawPath(testPath: string, rawPath: string): string
getModuleGraph(id: string): Promise<ModuleGraphData>
getTransformResult(id: string): Promise<TransformResultWithSource | undefined>
readSnapshotFile(id: string): Promise<string | null>
readTestFile(id: string): Promise<string | null>
saveTestFile(id: string, content: string): Promise<void>
saveSnapshotFile(id: string, content: string): Promise<void>
removeSnapshotFile(id: string): Promise<void>
snapshotSaved(snapshot: SnapshotResult): void
rerun(files: string[]): Promise<void>
updateSnapshot(file?: File): Promise<void>
getProvidedContext(): ProvidedContext
getUnhandledErrors(): unknown[]
onUnhandledError: (error: unknown, type: string) => Promise<void>
onCollected: (files?: File[]) => Promise<void>
onTaskUpdate: (packs: TaskResultPack[]) => void
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void
onCancel: (reason: CancelReason) => void
getCountOfFailedTests: () => number
sendLog: (log: UserConsoleLog) => void
getFiles: () => File[]
getPaths: () => string[]
getConfig: () => ResolvedConfig
resolveSnapshotPath: (testPath: string) => string
resolveSnapshotRawPath: (testPath: string, rawPath: string) => string
getModuleGraph: (id: string) => Promise<ModuleGraphData>
getTransformResult: (id: string) => Promise<TransformResultWithSource | undefined>
readSnapshotFile: (id: string) => Promise<string | null>
readTestFile: (id: string) => Promise<string | null>
saveTestFile: (id: string, content: string) => Promise<void>
saveSnapshotFile: (id: string, content: string) => Promise<void>
removeSnapshotFile: (id: string) => Promise<void>
snapshotSaved: (snapshot: SnapshotResult) => void
rerun: (files: string[]) => Promise<void>
updateSnapshot: (file?: File) => Promise<void>
getProvidedContext: () => ProvidedContext
getUnhandledErrors: () => unknown[]
finishBrowserTests(): void
getBrowserFiles(): string[]
debug(...args: string[]): void
finishBrowserTests: () => void
getBrowserFiles: () => string[]
debug: (...args: string[]) => void
}
export interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog' | 'onPathsCollected'> {
onCancel(reason: CancelReason): void
onCancel: (reason: CancelReason) => void
}
+40 -45
View File
@@ -18,76 +18,76 @@ export interface VitestUtils {
/**
* Checks if fake timers are enabled.
*/
isFakeTimers(): boolean
isFakeTimers: () => boolean
/**
* This method wraps all further calls to timers until [`vi.useRealTimers()`](https://vitest.dev/api/vi#vi-userealtimers) is called.
*/
useFakeTimers(config?: FakeTimerInstallOpts): VitestUtils
useFakeTimers: (config?: FakeTimerInstallOpts) => VitestUtils
/**
* Restores mocked timers to their original implementations. All timers that were scheduled before will be discarded.
*/
useRealTimers(): VitestUtils
useRealTimers: () => VitestUtils
/**
* This method will call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call.
* It will not fire any timer that was initiated during its call.
*/
runOnlyPendingTimers(): VitestUtils
runOnlyPendingTimers: () => VitestUtils
/**
* This method will asynchronously call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call, even asynchronous ones.
* It will not fire any timer that was initiated during its call.
*/
runOnlyPendingTimersAsync(): Promise<VitestUtils>
runOnlyPendingTimersAsync: () => Promise<VitestUtils>
/**
* This method will invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimers` will be fired.
* If you have an infinite interval, it will throw after 10,000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/#faketimers-looplimit)).
*/
runAllTimers(): VitestUtils
runAllTimers: () => VitestUtils
/**
* This method will asynchronously invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimersAsync` will be fired even asynchronous timers.
* If you have an infinite interval, it will throw after 10 000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/#faketimers-looplimit)).
*/
runAllTimersAsync(): Promise<VitestUtils>
runAllTimersAsync: () => Promise<VitestUtils>
/**
* Calls every microtask that was queued by `process.nextTick`. This will also run all microtasks scheduled by themselves.
*/
runAllTicks(): VitestUtils
runAllTicks: () => VitestUtils
/**
* This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first.
*/
advanceTimersByTime(ms: number): VitestUtils
advanceTimersByTime: (ms: number) => VitestUtils
/**
* This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first. This will include and await asynchronously set timers.
*/
advanceTimersByTimeAsync(ms: number): Promise<VitestUtils>
advanceTimersByTimeAsync: (ms: number) => Promise<VitestUtils>
/**
* Will call next available timer. Useful to make assertions between each timer call. You can chain call it to manage timers by yourself.
*/
advanceTimersToNextTimer(): VitestUtils
advanceTimersToNextTimer: () => VitestUtils
/**
* Will call next available timer and wait until it's resolved if it was set asynchronously. Useful to make assertions between each timer call.
*/
advanceTimersToNextTimerAsync(): Promise<VitestUtils>
advanceTimersToNextTimerAsync: () => Promise<VitestUtils>
/**
* Get the number of waiting timers.
*/
getTimerCount(): number
getTimerCount: () => number
/**
* If fake timers are enabled, this method simulates a user changing the system clock (will affect date related API like `hrtime`, `performance.now` or `new Date()`) - however, it will not fire any timers.
* If fake timers are not enabled, this method will only mock `Date.*` and `new Date()` calls.
*/
setSystemTime(time: number | string | Date): VitestUtils
setSystemTime: (time: number | string | Date) => VitestUtils
/**
* Returns mocked current date that was set using `setSystemTime`. If date is not mocked the method will return `null`.
*/
getMockedSystemTime(): Date | null
getMockedSystemTime: () => Date | null
/**
* When using `vi.useFakeTimers`, `Date.now` calls are mocked. If you need to get real time in milliseconds, you can call this function.
*/
getRealSystemTime(): number
getRealSystemTime: () => number
/**
* Removes all timers that are scheduled to run. These timers will never run in the future.
*/
clearAllTimers(): VitestUtils
clearAllTimers: () => VitestUtils
/**
* Creates a spy on a method or getter/setter of an object similar to [`vi.fn()`](https://vitest.dev/api/vi#vi-fn). It returns a [mock function](https://vitest.dev/api/mock).
@@ -172,7 +172,7 @@ export interface VitestUtils {
*
* If used with [`vi.mock`](https://vitest.dev/api/vi#vi-mock), both will be hoisted in the order they are defined in.
*/
hoisted<T>(factory: () => T): T
hoisted: <T>(factory: () => T) => T
/**
* Mocks every import call to the module even if it was already statically imported.
@@ -184,7 +184,7 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your Vitest config supports it
* @param factory Mocked module factory. The result of this function will be an exports object
*/
mock(path: string, factory?: MockFactoryWithHelper): void
mock: (path: string, factory?: MockFactoryWithHelper) => void
/**
* Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.
@@ -192,7 +192,7 @@ export interface VitestUtils {
* This call is hoisted to the top of the file, so it will only unmock modules that were defined in `setupFiles`, for example.
* @param path Path to the module. Can be aliased, if your Vitest config supports it
*/
unmock(path: string): void
unmock: (path: string) => void
/**
* Mocks every subsequent [dynamic import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) call.
@@ -203,14 +203,14 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your Vitest config supports it
* @param factory Mocked module factory. The result of this function will be an exports object
*/
doMock(path: string, factory?: MockFactoryWithHelper): void
doMock: (path: string, factory?: MockFactoryWithHelper) => void
/**
* Removes module from mocked registry. All subsequent calls to import will return original module.
*
* Unlike [`vi.unmock`](https://vitest.dev/api/vi#vi-unmock), this method is not hoisted to the top of the file.
* @param path Path to the module. Can be aliased, if your Vitest config supports it
*/
doUnmock(path: string): void
doUnmock: (path: string) => void
/**
* Imports module, bypassing all checks if it should be mocked.
@@ -223,7 +223,7 @@ export interface VitestUtils {
* })
* @param path Path to the module. Can be aliased, if your config supports it
*/
importActual<T = ESModuleExports>(path: string): Promise<T>
importActual: <T = ESModuleExports>(path: string) => Promise<T>
/**
* Imports a module with all of its properties and nested properties mocked.
@@ -236,7 +236,7 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your config supports it
* @returns Fully mocked module
*/
importMock<T = ESModuleExports>(path: string): Promise<MaybeMockedDeep<T>>
importMock: <T = ESModuleExports>(path: string) => Promise<MaybeMockedDeep<T>>
/**
* Type helper for TypeScript. Just returns the object that was passed.
@@ -255,60 +255,54 @@ export interface VitestUtils {
* @param deep If the object is deeply mocked
* @param options If the object is partially or deeply mocked
*/
mocked<T>(item: T, deep?: false): MaybeMocked<T>
mocked<T>(item: T, deep: true): MaybeMockedDeep<T>
mocked<T>(item: T, options: { partial?: false; deep?: false }): MaybeMocked<T>
mocked<T>(item: T, options: { partial?: false; deep: true }): MaybeMockedDeep<T>
mocked<T>(item: T, options: { partial: true; deep?: false }): MaybePartiallyMocked<T>
mocked<T>(item: T, options: { partial: true; deep: true }): MaybePartiallyMockedDeep<T>
mocked<T>(item: T): MaybeMocked<T>
mocked: (<T>(item: T, deep?: false) => MaybeMocked<T>) & (<T>(item: T, deep: true) => MaybeMockedDeep<T>) & (<T>(item: T, options: { partial?: false; deep?: false }) => MaybeMocked<T>) & (<T>(item: T, options: { partial?: false; deep: true }) => MaybeMockedDeep<T>) & (<T>(item: T, options: { partial: true; deep?: false }) => MaybePartiallyMocked<T>) & (<T>(item: T, options: { partial: true; deep: true }) => MaybePartiallyMockedDeep<T>) & (<T>(item: T) => MaybeMocked<T>)
/**
* Checks that a given parameter is a mock function. If you are using TypeScript, it will also narrow down its type.
*/
isMockFunction(fn: any): fn is MockInstance
isMockFunction: (fn: any) => fn is MockInstance
/**
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will only empty `.mock` state, it will not reset implementation.
*
* It is useful if you need to clean up mock between different assertions.
*/
clearAllMocks(): VitestUtils
clearAllMocks: () => VitestUtils
/**
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function. This will empty `.mock` state, reset "once" implementations and force the base implementation to return `undefined` when invoked.
*
* This is useful when you want to completely reset a mock to the default state.
*/
resetAllMocks(): VitestUtils
resetAllMocks: () => VitestUtils
/**
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function. This will restore all original implementations.
*/
restoreAllMocks(): VitestUtils
restoreAllMocks: () => VitestUtils
/**
* Makes value available on global namespace.
* Useful, if you want to have global variables available, like `IntersectionObserver`.
* You can return it back to original value with `vi.unstubAllGlobals`, or by enabling `unstubGlobals` config option.
*/
stubGlobal(name: string | symbol | number, value: unknown): VitestUtils
stubGlobal: (name: string | symbol | number, value: unknown) => VitestUtils
/**
* Changes the value of `import.meta.env` and `process.env`.
* You can return it back to original value with `vi.unstubAllEnvs`, or by enabling `unstubEnvs` config option.
*/
stubEnv(name: string, value: string): VitestUtils
stubEnv: (name: string, value: string) => VitestUtils
/**
* Reset the value to original value that was available before first `vi.stubGlobal` was called.
*/
unstubAllGlobals(): VitestUtils
unstubAllGlobals: () => VitestUtils
/**
* Reset environmental variables to the ones that were available before first `vi.stubEnv` was called.
*/
unstubAllEnvs(): VitestUtils
unstubAllEnvs: () => VitestUtils
/**
* Resets modules registry by clearing the cache of all modules. This allows modules to be reevaluated when reimported.
@@ -316,24 +310,24 @@ export interface VitestUtils {
*
* This method does not reset mocks registry. To clear mocks registry, use [`vi.unmock`](https://vitest.dev/api/vi#vi-unmock) or [`vi.doUnmock`](https://vitest.dev/api/vi#vi-dounmock).
*/
resetModules(): VitestUtils
resetModules: () => VitestUtils
/**
* Wait for all imports to load. Useful, if you have a synchronous call that starts
* importing a module that you cannot await otherwise.
* Will also wait for new imports, started during the wait.
*/
dynamicImportSettled(): Promise<void>
dynamicImportSettled: () => Promise<void>
/**
* Updates runtime config. You can only change values that are used when executing tests.
*/
setConfig(config: RuntimeConfig): void
setConfig: (config: RuntimeConfig) => void
/**
* If config was changed with `vi.setConfig`, this will reset it to the original state.
*/
resetConfig(): void
resetConfig: () => void
}
function createVitest(): VitestUtils {
@@ -518,8 +512,9 @@ function createVitest(): VitestUtils {
return _mocker.importMock(path, getImporter())
},
mocked<T>(item: T, _options = {}): MaybeMocked<T> {
return item as any
// this is typed in the interface so it's not necessary to type it here
mocked<T>(item: T, _options = {}): any {
return item
},
isMockFunction(fn: any): fn is MockInstance {
+1 -1
View File
@@ -5,7 +5,7 @@ import type { ResolvedConfig } from '../types/config'
export interface GlobalSetupContext {
config: ResolvedConfig
provide<T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]): void
provide: <T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]) => void
}
export interface GlobalSetupFile {
+2 -2
View File
@@ -7,8 +7,8 @@ export interface TestSequencer {
* Slicing tests into shards. Will be run before `sort`.
* Only run, if `shard` is defined.
*/
shard(files: WorkspaceSpec[]): Awaitable<WorkspaceSpec[]>
sort(files: WorkspaceSpec[]): Awaitable<WorkspaceSpec[]>
shard: (files: WorkspaceSpec[]) => Awaitable<WorkspaceSpec[]>
sort: (files: WorkspaceSpec[]) => Awaitable<WorkspaceSpec[]>
}
export interface TestSequencerConstructor {
+2 -2
View File
@@ -72,8 +72,8 @@ export class WorkspaceProject {
browserState: {
files: string[]
resolve(): void
reject(v: unknown): void
resolve: () => void
reject: (v: unknown) => void
} | undefined
testFilesList: string[] | null = null
+8 -8
View File
@@ -1,4 +1,4 @@
import type { CancelReason, Custom, ExtendedContext, Suite, TaskContext, Test, VitestRunner, VitestRunnerImportSource } from '@vitest/runner'
import type { CancelReason, Custom, ExtendedContext, Suite, Task, TaskContext, Test, VitestRunner, VitestRunnerImportSource } from '@vitest/runner'
import type { ExpectStatic } from '@vitest/expect'
import { GLOBAL_EXPECT, getState, setState } from '@vitest/expect'
import { getSnapshotClient } from '../../integrations/snapshot/chai'
@@ -46,7 +46,7 @@ export class VitestTestRunner implements VitestRunner {
}
}
onAfterRunTask(test: Test) {
onAfterRunTask(test: Task) {
this.snapshotClient.clearTest()
if (this.config.logHeapUsage && typeof process !== 'undefined')
@@ -59,7 +59,7 @@ export class VitestTestRunner implements VitestRunner {
this.cancelRun = true
}
async onBeforeRunTask(test: Test) {
async onBeforeRunTask(test: Task) {
if (this.cancelRun)
test.mode = 'skip'
@@ -83,28 +83,28 @@ export class VitestTestRunner implements VitestRunner {
}
}
onBeforeTryTask(test: Test) {
onBeforeTryTask(test: Task) {
setState({
assertionCalls: 0,
isExpectingAssertions: false,
isExpectingAssertionsError: null,
expectedAssertionsNumber: null,
expectedAssertionsNumberErrorGen: null,
testPath: test.suite.file?.filepath,
testPath: test.suite?.file?.filepath,
currentTestName: getFullName(test),
snapshotState: this.snapshotClient.snapshotState,
}, (globalThis as any)[GLOBAL_EXPECT])
}
onAfterTryTask(test: Test) {
onAfterTryTask(test: Task) {
const {
assertionCalls,
expectedAssertionsNumber,
expectedAssertionsNumberErrorGen,
isExpectingAssertions,
isExpectingAssertionsError,
// @ts-expect-error local is untyped
} = test.context._local
// @ts-expect-error _local is untyped
} = 'context' in test && test.context._local
? test.context.expect.getState()
: getState((globalThis as any)[GLOBAL_EXPECT])
if (expectedAssertionsNumber !== null && assertionCalls !== expectedAssertionsNumber)
@@ -14,7 +14,7 @@ interface CommonjsExecutorOptions {
const _require = createRequire(import.meta.url)
interface PrivateNodeModule extends NodeModule {
_compile(code: string, filename: string): void
_compile: (code: string, filename: string) => void
}
const requiresCache = new WeakMap<NodeModule, NodeRequire>()
@@ -1,11 +1,12 @@
import type { ContextRPC } from '../../types/rpc'
import type { WorkerContext, WorkerGlobalState } from '../../types/worker'
import { runBaseTests } from './base'
import type { VitestWorker } from './types'
import { createThreadsRpcOptions } from './utils'
class ThreadsBaseWorker implements VitestWorker {
getRpcOptions(ctx: WorkerContext) {
return createThreadsRpcOptions(ctx)
getRpcOptions(ctx: ContextRPC) {
return createThreadsRpcOptions(ctx as WorkerContext)
}
runTests(state: WorkerGlobalState): unknown {
+2 -2
View File
@@ -6,6 +6,6 @@ import type { WorkerGlobalState } from '../../types/worker'
export type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, 'on' | 'post' | 'serialize' | 'deserialize'>
export interface VitestWorker {
getRpcOptions(ctx: ContextRPC): WorkerRpcOptions
runTests(state: WorkerGlobalState): Awaitable<unknown>
getRpcOptions: (ctx: ContextRPC) => WorkerRpcOptions
runTests: (state: WorkerGlobalState) => Awaitable<unknown>
}
@@ -1,11 +1,12 @@
import type { ContextRPC } from '../../types/rpc'
import type { WorkerContext, WorkerGlobalState } from '../../types/worker'
import type { VitestWorker, WorkerRpcOptions } from './types'
import { createThreadsRpcOptions } from './utils'
import { runVmTests } from './vm'
class ThreadsVmWorker implements VitestWorker {
getRpcOptions(ctx: WorkerContext): WorkerRpcOptions {
return createThreadsRpcOptions(ctx)
getRpcOptions(ctx: ContextRPC): WorkerRpcOptions {
return createThreadsRpcOptions(ctx as WorkerContext)
}
runTests(state: WorkerGlobalState): unknown {
+2 -2
View File
@@ -58,8 +58,8 @@ type ChainableBenchmarkAPI = ChainableFunction<
void
>
export type BenchmarkAPI = ChainableBenchmarkAPI & {
skipIf(condition: any): ChainableBenchmarkAPI
runIf(condition: any): ChainableBenchmarkAPI
skipIf: (condition: any) => ChainableBenchmarkAPI
runIf: (condition: any) => ChainableBenchmarkAPI
}
export {
+8 -4
View File
@@ -9,10 +9,14 @@ export interface BrowserProviderInitializationOptions {
export interface BrowserProvider {
name: string
getSupportedBrowsers(): readonly string[]
initialize(ctx: WorkspaceProject, options: BrowserProviderInitializationOptions): Awaitable<void>
openPage(url: string): Awaitable<void>
close(): Awaitable<void>
getSupportedBrowsers: () => readonly string[]
openPage: (url: string) => Awaitable<void>
close: () => Awaitable<void>
// eslint-disable-next-line ts/method-signature-style -- we want to allow extended options
initialize(
ctx: WorkspaceProject,
options: BrowserProviderInitializationOptions
): Awaitable<void>
}
export interface BrowserProviderModule {
+11 -11
View File
@@ -8,21 +8,21 @@ type TransformResult = string | Partial<ViteTransformResult> | undefined | null
export interface CoverageProvider {
name: string
initialize(ctx: Vitest): Promise<void> | void
initialize: (ctx: Vitest) => Promise<void> | void
resolveOptions(): ResolvedCoverageOptions
clean(clean?: boolean): void | Promise<void>
resolveOptions: () => ResolvedCoverageOptions
clean: (clean?: boolean) => void | Promise<void>
onAfterSuiteRun(meta: AfterSuiteRunMeta): void | Promise<void>
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void | Promise<void>
reportCoverage(reportContext?: ReportContext): void | Promise<void>
reportCoverage: (reportContext?: ReportContext) => void | Promise<void>
onFileTransform?(
onFileTransform?: (
sourceCode: string,
id: string,
// TODO: when upgrading vite, import Rollup from vite
pluginCtx: any
): TransformResult | Promise<TransformResult>
) => TransformResult | Promise<TransformResult>
}
export interface ReportContext {
@@ -34,22 +34,22 @@ export interface CoverageProviderModule {
/**
* Factory for creating a new coverage provider
*/
getProvider(): CoverageProvider | Promise<CoverageProvider>
getProvider: () => CoverageProvider | Promise<CoverageProvider>
/**
* Executed before tests are run in the worker thread.
*/
startCoverage?(): unknown | Promise<unknown>
startCoverage?: () => unknown | Promise<unknown>
/**
* Executed on after each run in the worker thread. Possible to return a payload passed to the provider
*/
takeCoverage?(): unknown | Promise<unknown>
takeCoverage?: () => unknown | Promise<unknown>
/**
* Executed after all tests have been run in the worker thread.
*/
stopCoverage?(): unknown | Promise<unknown>
stopCoverage?: () => unknown | Promise<unknown>
}
export type CoverageReporter = keyof ReportOptions | (string & {})
+5 -5
View File
@@ -18,19 +18,19 @@ export interface ModuleCache {
}
export interface EnvironmentReturn {
teardown(global: any): Awaitable<void>
teardown: (global: any) => Awaitable<void>
}
export interface VmEnvironmentReturn {
getVmContext(): { [key: string]: any }
teardown(): Awaitable<void>
getVmContext: () => { [key: string]: any }
teardown: () => Awaitable<void>
}
export interface Environment {
name: string
transformMode: 'web' | 'ssr'
setupVM?(options: Record<string, any>): Awaitable<VmEnvironmentReturn>
setup(global: any, options: Record<string, any>): Awaitable<EnvironmentReturn>
setupVM?: (options: Record<string, any>) => Awaitable<VmEnvironmentReturn>
setup: (global: any, options: Record<string, any>) => Awaitable<EnvironmentReturn>
}
export interface UserConsoleLog {
+19 -12
View File
@@ -9,14 +9,24 @@ declare global {
// eslint-disable-next-line ts/no-namespace
namespace Chai {
interface Assertion {
containSubset(expected: any): Assertion
containSubset: (expected: any) => Assertion
}
interface Assert {
containSubset(val: any, exp: any, msg?: string): void
containSubset: (val: any, exp: any, msg?: string) => void
}
}
}
interface SnapshotMatcher<T> {
<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
(message?: string): void
}
interface InlineSnapshotMatcher<T> {
<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
(message?: string): void
}
declare module '@vitest/expect' {
interface MatcherState {
environment: VitestEnvironment
@@ -24,20 +34,17 @@ declare module '@vitest/expect' {
}
interface ExpectStatic {
addSnapshotSerializer(plugin: PrettyFormatPlugin): void
addSnapshotSerializer: (plugin: PrettyFormatPlugin) => void
}
interface Assertion<T> {
// Snapshots are extended in @vitest/snapshot and are not part of @vitest/expect
matchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
matchSnapshot(message?: string): void
toMatchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
toMatchSnapshot(message?: string): void
toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
toMatchInlineSnapshot(snapshot?: string, message?: string): void
toThrowErrorMatchingSnapshot(message?: string): void
toThrowErrorMatchingInlineSnapshot(snapshot?: string, message?: string): void
toMatchFileSnapshot(filepath: string, message?: string): Promise<void>
matchSnapshot: SnapshotMatcher<T>
toMatchSnapshot: SnapshotMatcher<T>
toMatchInlineSnapshot: InlineSnapshotMatcher<T>
toThrowErrorMatchingSnapshot: (message?: string) => void
toThrowErrorMatchingInlineSnapshot: (snapshot?: string, message?: string) => void
toMatchFileSnapshot: (filepath: string, message?: string) => Promise<void>
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ import type { Awaitable, UserConsoleLog } from './general'
import type { File, TaskResultPack } from './tasks'
export interface Reporter {
onInit?(ctx: Vitest): void
onInit?: (ctx: Vitest) => void
onPathsCollected?: (paths?: string[]) => Awaitable<void>
onCollected?: (files?: File[]) => Awaitable<void>
onFinished?: (files?: File[], errors?: unknown[]) => Awaitable<void>
+2 -2
View File
@@ -1,5 +1,5 @@
import type { MessagePort } from 'node:worker_threads'
import type { CancelReason, Test } from '@vitest/runner'
import type { CancelReason, Task } from '@vitest/runner'
import type { ModuleCacheMap, ViteNodeResolveId } from 'vite-node'
import type { BirpcReturn } from 'birpc'
import type { MockMap } from './mocker'
@@ -25,7 +25,7 @@ export interface WorkerGlobalState {
ctx: ContextRPC
config: ResolvedConfig
rpc: WorkerRPC
current?: Test
current?: Task
filepath?: string
environment: Environment
environmentTeardownRun?: boolean
+1 -1
View File
@@ -21,7 +21,7 @@ export class BaseCoverageProvider {
updateThresholds({ thresholds: allThresholds, perFile, configurationFile }: {
thresholds: ResolvedThreshold[]
perFile?: boolean
configurationFile: { read(): unknown; write(): void }
configurationFile: { read: () => unknown; write: () => void }
}) {
let updatedThresholds = false
+2 -2
View File
@@ -24,8 +24,8 @@ export interface VitestClient {
ws: WebSocket
state: StateManager
rpc: BirpcReturn<WebSocketHandlers, WebSocketEvents>
waitForConnection(): Promise<void>
reconnect(): Promise<void>
waitForConnection: () => Promise<void>
reconnect: () => Promise<void>
}
export function createClient(url: string, options: VitestClientOptions = {}) {
+246 -138
View File
@@ -25,8 +25,8 @@ importers:
.:
devDependencies:
'@antfu/eslint-config':
specifier: ^1.2.1
version: 1.2.1([email protected])([email protected])(vitest@packages+vitest)
specifier: ^2.6.4
version: 2.6.4(@vue/[email protected])([email protected])([email protected])(vitest@packages+vitest)
'@antfu/ni':
specifier: ^0.21.12
version: 0.21.12
@@ -1231,7 +1231,7 @@ importers:
version: 5.0.12(@types/[email protected])([email protected])
vite-plugin-pages:
specifier: ^0.31.0
version: 0.31.0([email protected])
version: 0.31.0(@vue/[email protected])([email protected])
vue:
specifier: ^3.3.8
version: 3.3.8([email protected])
@@ -2251,52 +2251,78 @@ packages:
'@jridgewell/gen-mapping': 0.3.2
'@jridgewell/trace-mapping': 0.3.18
/@antfu/eslint-config@1.2.1([email protected])([email protected])(vitest@packages+vitest):
resolution: {integrity: sha512-/B7jSc9RARxGNZUoxkB2EL7pL7v5ubt25Ah3QbQaCalcIOC3YF+60mL4/G8Oi9Rtdng7ytNGg3bi50voKfqINQ==}
/@antfu/eslint-config@2.6.4(@vue/[email protected])([email protected])([email protected])(vitest@packages+vitest):
resolution: {integrity: sha512-dMD/QC5KWS1OltdpKLhfZM7W7y7zils85opk8d4lyNr7yn0OFjZs7eMYtcC6DrrN2kQ1JrFvBM7uB0QdWn5PUQ==}
hasBin: true
peerDependencies:
eslint: '>=8.0.0'
'@unocss/eslint-plugin': '>=0.50.0'
eslint: '>=8.40.0'
eslint-plugin-format: '>=0.1.0'
eslint-plugin-react: ^7.33.2
eslint-plugin-react-hooks: ^4.6.0
eslint-plugin-react-refresh: ^0.4.4
eslint-plugin-svelte: ^2.34.1
svelte-eslint-parser: ^0.33.1
peerDependenciesMeta:
'@unocss/eslint-plugin':
optional: true
eslint-plugin-format:
optional: true
eslint-plugin-react:
optional: true
eslint-plugin-react-hooks:
optional: true
eslint-plugin-react-refresh:
optional: true
eslint-plugin-svelte:
optional: true
svelte-eslint-parser:
optional: true
dependencies:
'@antfu/eslint-define-config': 1.23.0-2
'@antfu/install-pkg': 0.3.1
'@eslint-types/jsdoc': 46.8.2-1
'@eslint-types/typescript-eslint': 6.19.1
'@eslint-types/unicorn': 49.0.0
'@eslint-types/unicorn': 50.0.1
'@stylistic/eslint-plugin': 1.6.0([email protected])([email protected])
'@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
'@typescript-eslint/parser': 6.21.0([email protected])([email protected])
eslint: 8.54.0
eslint-config-flat-gitignore: 0.1.1
eslint-plugin-antfu: 1.0.13([email protected])
eslint-config-flat-gitignore: 0.1.2
eslint-merge-processors: 0.1.0([email protected])
eslint-plugin-antfu: 2.1.2([email protected])
eslint-plugin-eslint-comments: 3.2.0([email protected])
eslint-plugin-i: 2.29.0(@typescript-eslint/[email protected])([email protected])
eslint-plugin-jsdoc: 46.9.0([email protected])
eslint-plugin-jsonc: 2.10.0([email protected])
eslint-plugin-i: 2.29.1(@typescript-eslint/[email protected])([email protected])
eslint-plugin-jsdoc: 48.0.6([email protected])
eslint-plugin-jsonc: 2.13.0([email protected])
eslint-plugin-markdown: 3.0.1([email protected])
eslint-plugin-n: 16.3.1([email protected])
eslint-plugin-n: 16.6.2([email protected])
eslint-plugin-no-only-tests: 3.1.0
eslint-plugin-perfectionist: 2.5.0([email protected])([email protected])(vue-eslint-parser@9.3.2)
eslint-plugin-unicorn: 49.0.0([email protected])
eslint-plugin-perfectionist: 2.5.0([email protected])([email protected])(vue-eslint-parser@9.4.2)
eslint-plugin-toml: 0.9.2([email protected])
eslint-plugin-unicorn: 50.0.1([email protected])
eslint-plugin-unused-imports: 3.0.0(@typescript-eslint/[email protected])([email protected])
eslint-plugin-vitest: 0.3.9(@typescript-eslint/[email protected])([email protected])([email protected])(vitest@packages+vitest)
eslint-plugin-vue: 9.18.1([email protected])
eslint-plugin-yml: 1.10.0([email protected])
execa: 8.0.1
globals: 13.23.0
eslint-plugin-vitest: 0.3.22(@typescript-eslint/[email protected])([email protected])([email protected])(vitest@packages+vitest)
eslint-plugin-vue: 9.21.1([email protected])
eslint-plugin-yml: 1.12.2([email protected])
eslint-processor-vue-blocks: 0.1.1(@vue/[email protected])([email protected])
globals: 13.24.0
jsonc-eslint-parser: 2.4.0
local-pkg: 0.5.0
parse-gitignore: 2.0.0
picocolors: 1.0.0
prompts: 2.4.2
vue-eslint-parser: 9.3.2([email protected])
toml-eslint-parser: 0.9.3
vue-eslint-parser: 9.4.2([email protected])
yaml-eslint-parser: 1.2.2
yargs: 17.7.2
transitivePeerDependencies:
- '@vue/compiler-sfc'
- astro-eslint-parser
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
- svelte
- svelte-eslint-parser
- typescript
- vitest
dev: true
@@ -5054,8 +5080,8 @@ packages:
resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==}
dev: false
/@es-joy/[email protected]1.0:
resolution: {integrity: sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==}
/@es-joy/[email protected]2.0:
resolution: {integrity: sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==}
engines: {node: '>=16'}
dependencies:
comment-parser: 1.4.1
@@ -5507,8 +5533,8 @@ packages:
resolution: {integrity: sha512-X0farz1+psE6Qfx6+ISQQ/J3ZetKlUeuTIN9Zt/agx4UXrgK6daH/n9ba776JxysK6YJCRaEHng/bcQQUm+BsA==}
dev: true
/@eslint-types/unicorn@49.0.0:
resolution: {integrity: sha512-NfXSZIsPFRD2fwTDZQj8SaXqS/rXjB5foxMraLovyrYGXiQK2y0780drDKYYSVbqvco29QIYoZNmnKTUkzZMvQ==}
/@eslint-types/unicorn@50.0.1:
resolution: {integrity: sha512-nuJuipTNcg9f+oxZ+3QZw4tuDLmir4RJOPfM/oujgToiy1s+tePDZhwg5jUGc3q8OzTtPbVpsFSYX7QApjO3EA==}
dev: true
/@eslint/[email protected]:
@@ -5545,6 +5571,23 @@ packages:
- supports-color
dev: true
/@eslint/[email protected]:
resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
debug: 4.3.4([email protected])
espree: 9.6.1
globals: 13.24.0
ignore: 5.2.4
import-fresh: 3.3.0
js-yaml: 4.1.0
minimatch: 3.1.2
strip-json-comments: 3.1.1
transitivePeerDependencies:
- supports-color
dev: true
/@eslint/[email protected]:
resolution: {integrity: sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -9750,14 +9793,6 @@ packages:
- supports-color
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/visitor-keys': 6.10.0
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -9786,37 +9821,11 @@ packages:
- supports-color
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/[email protected]([email protected]):
resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/visitor-keys': 6.10.0
debug: 4.3.4([email protected])
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
ts-api-utils: 1.0.3([email protected])
typescript: 5.2.2
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/[email protected]([email protected]):
resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -9839,25 +9848,6 @@ packages:
- supports-color
dev: true
/@typescript-eslint/[email protected]([email protected])([email protected]):
resolution: {integrity: sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
dependencies:
'@eslint-community/eslint-utils': 4.4.0([email protected])
'@types/json-schema': 7.0.14
'@types/semver': 7.5.5
'@typescript-eslint/scope-manager': 6.10.0
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/typescript-estree': 6.10.0([email protected])
eslint: 8.54.0
semver: 7.5.4
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@typescript-eslint/[email protected]([email protected])([email protected]):
resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -9877,14 +9867,6 @@ packages:
- typescript
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.10.0
eslint-visitor-keys: 3.4.3
dev: true
/@typescript-eslint/[email protected]:
resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -12446,6 +12428,17 @@ packages:
node-releases: 2.0.13
update-browserslist-db: 1.0.13([email protected])
/[email protected]:
resolution: {integrity: sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
caniuse-lite: 1.0.30001585
electron-to-chromium: 1.4.661
node-releases: 2.0.14
update-browserslist-db: 1.0.13([email protected])
dev: true
/[email protected]:
resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==}
dependencies:
@@ -12732,6 +12725,10 @@ packages:
/[email protected]:
resolution: {integrity: sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==}
/[email protected]:
resolution: {integrity: sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==}
dev: true
/[email protected]:
resolution: {integrity: sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==}
engines: {node: 6.* || 8.* || >= 10.*}
@@ -12941,6 +12938,11 @@ packages:
engines: {node: '>=8'}
dev: true
/[email protected]:
resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==}
engines: {node: '>=8'}
dev: true
/[email protected]:
resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==}
dependencies:
@@ -13396,6 +13398,12 @@ packages:
browserslist: 4.22.1
dev: true
/[email protected]:
resolution: {integrity: sha512-sftHa5qUJY3rs9Zht1WEnmkvXputCyDBczPnr7QDgL8n3qrF3CMXY4VPSYtOLLiOUJcah2WNXREd48iOl6mQIw==}
dependencies:
browserslist: 4.22.3
dev: true
/[email protected]:
resolution: {integrity: sha512-IeHpLwk3uoci37yoI2Laty59+YqH9x5uR65/yiA0ARAJrTrN4YU0rmauLWfvqOuk77SlNJXj2rM6oT/dBD87+A==}
requiresBuild: true
@@ -14303,13 +14311,6 @@ packages:
path-type: 4.0.0
dev: true
/[email protected]:
resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
engines: {node: '>=0.10.0'}
dependencies:
esutils: 2.0.3
dev: true
/[email protected]:
resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
engines: {node: '>=6.0.0'}
@@ -14538,6 +14539,10 @@ packages:
/[email protected]:
resolution: {integrity: sha512-eS5t4ulWOBfVHdq9SW2dxEaFarj1lPjvJ8PaYMOjY0DecBaj/t4ARziL2IPpDr4atyWwjLFGQ2vo/VCgQFezVQ==}
/[email protected]:
resolution: {integrity: sha512-AFg4wDHSOk5F+zA8aR+SVIOabu7m0e7BiJnigCvPXzIGy731XENw/lmNxTySpVFtkFEy+eyt4oHhh5FF3NjQNw==}
dev: true
/[email protected]:
resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==}
dependencies:
@@ -15128,8 +15133,18 @@ packages:
eslint: 8.54.0
dev: true
/eslint-config-flat-gitignore@0.1.1:
resolution: {integrity: sha512-ysq0QpN63+uaxE67U0g0HeCweIpv8Ztp7yvm0nYiM2TBalRIG6KQLO5J6lAz2gkA8KVis/QsJppe+BR5VigtWQ==}
/eslint-compat-utils@0.4.1([email protected]):
resolution: {integrity: sha512-5N7ZaJG5pZxUeNNJfUchurLVrunD1xJvyg5kYOIVF8kg1f3ajTikmAu/5fZ9w100omNPOoMjngRszh/Q/uFGMg==}
engines: {node: '>=12'}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
eslint: 8.54.0
semver: 7.5.4
dev: true
/[email protected]:
resolution: {integrity: sha512-PcBsqtd5QHEZH4ROvpnRN4EP0qcHh9voCCHgtyHxnJZHGspJREcZn7oPqRG/GfWt9m3C0fkC2l5CuBtMig2wXQ==}
dependencies:
parse-gitignore: 2.0.0
dev: true
@@ -15144,6 +15159,14 @@ packages:
- supports-color
dev: true
/[email protected]([email protected]):
resolution: {integrity: sha512-IvRXXtEajLeyssvW4wJcZ2etxkR9mUf4zpNwgI+m/Uac9RfXHskuJefkHUcawVzePnd6xp24enp5jfgdHzjRdQ==}
peerDependencies:
eslint: '*'
dependencies:
eslint: 8.54.0
dev: true
/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]):
resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
engines: {node: '>=4'}
@@ -15173,16 +15196,16 @@ packages:
- supports-color
dev: true
/eslint-plugin-antfu@1.0.13([email protected]):
resolution: {integrity: sha512-JzWEzNWZcNK4Q4Tz4VaNELhu3VgCv3obSYxUbK1UhbDBmr2v0a7H9n9xGv5GTS4LkEo905/2Gq6y0dcoBq5FZA==}
/eslint-plugin-antfu@2.1.2([email protected]):
resolution: {integrity: sha512-s7ZTOM3uq0iqpp6gF0UEotnvup7f2PHBUftCytLZX0+6C9j9KadKZQh6bVVngAyFgsmeD9+gcBopOYLClb2oDg==}
peerDependencies:
eslint: '*'
dependencies:
eslint: 8.54.0
dev: true
/eslint-plugin-es-x@7.3.0([email protected]):
resolution: {integrity: sha512-W9zIs+k00I/I13+Bdkl/zG1MEO07G97XjUSQuH117w620SJ6bHtLUmoMvkGA2oYnI/gNdr+G7BONLyYnFaLLEQ==}
/eslint-plugin-es-x@7.5.0([email protected]):
resolution: {integrity: sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
eslint: '>=8'
@@ -15190,6 +15213,7 @@ packages:
'@eslint-community/eslint-utils': 4.4.0([email protected])
'@eslint-community/regexpp': 4.10.0
eslint: 8.54.0
eslint-compat-utils: 0.1.2([email protected])
dev: true
/[email protected]([email protected]):
@@ -15203,21 +15227,20 @@ packages:
ignore: 5.2.4
dev: true
/[email protected].0(@typescript-eslint/[email protected])([email protected]):
resolution: {integrity: sha512-slGeTS3GQzx9267wLJnNYNO8X9EHGsc75AKIAFvnvMYEcTJKotPKL1Ru5PIGVHIVet+2DsugePWp8Oxpx8G22w==}
/[email protected].1(@typescript-eslint/[email protected])([email protected]):
resolution: {integrity: sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ==}
engines: {node: '>=12'}
peerDependencies:
eslint: ^7.2.0 || ^8
dependencies:
debug: 3.2.7([email protected])
doctrine: 2.1.0
debug: 4.3.4([email protected])
doctrine: 3.0.0
eslint: 8.54.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])
get-tsconfig: 4.7.2
is-glob: 4.0.3
minimatch: 3.1.2
resolve: 1.22.8
semver: 7.5.4
transitivePeerDependencies:
- '@typescript-eslint/parser'
@@ -15226,13 +15249,13 @@ packages:
- supports-color
dev: true
/eslint-plugin-jsdoc@46.9.0([email protected]):
resolution: {integrity: sha512-UQuEtbqLNkPf5Nr/6PPRCtr9xypXY+g8y/Q7gPa0YK7eDhh0y2lWprXRnaYbW7ACgIUvpDKy9X2bZqxtGzBG9Q==}
engines: {node: '>=16'}
/eslint-plugin-jsdoc@48.0.6([email protected]):
resolution: {integrity: sha512-LgwXOX6TWxxFYcbdVe+BJ94Kl/pgjSPYHLzqEdAMXTA1BH9WDx7iJ+9/iDajPF64LtzWX8C1mCfpbMZjJGhAOw==}
engines: {node: '>=18'}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
dependencies:
'@es-joy/jsdoccomment': 0.41.0
'@es-joy/jsdoccomment': 0.42.0
are-docs-informative: 0.0.2
comment-parser: 1.4.1
debug: 4.3.4([email protected])
@@ -15240,23 +15263,26 @@ packages:
eslint: 8.54.0
esquery: 1.5.0
is-builtin-module: 3.2.1
semver: 7.5.4
spdx-expression-parse: 3.0.1
semver: 7.6.0
spdx-expression-parse: 4.0.0
transitivePeerDependencies:
- supports-color
dev: true
/[email protected]0.0([email protected]):
resolution: {integrity: sha512-9d//o6Jyh4s1RxC9fNSt1+MMaFN2ruFdXPG9XZcb/mR2KkfjADYiNL/hbU6W0Cyxfg3tS/XSFuhl5LgtMD8hmw==}
/[email protected]3.0([email protected]):
resolution: {integrity: sha512-2wWdJfpO/UbZzPDABuUVvlUQjfMJa2p2iQfYt/oWxOMpXCcjuiMUSaA02gtY/Dbu82vpaSqc+O7Xq6ECHwtIxA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
'@eslint-community/eslint-utils': 4.4.0([email protected])
eslint: 8.54.0
eslint-compat-utils: 0.1.2([email protected])
eslint-compat-utils: 0.4.1([email protected])
espree: 9.6.1
graphemer: 1.4.0
jsonc-eslint-parser: 2.4.0
natural-compare: 1.4.0
synckit: 0.6.2
dev: true
/[email protected]([email protected]):
@@ -15271,8 +15297,8 @@ packages:
- supports-color
dev: true
/eslint-plugin-n@16.3.1([email protected]):
resolution: {integrity: sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==}
/eslint-plugin-n@16.6.2([email protected]):
resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==}
engines: {node: '>=16.0.0'}
peerDependencies:
eslint: '>=7.0.0'
@@ -15280,8 +15306,9 @@ packages:
'@eslint-community/eslint-utils': 4.4.0([email protected])
builtins: 5.0.1
eslint: 8.54.0
eslint-plugin-es-x: 7.3.0([email protected])
eslint-plugin-es-x: 7.5.0([email protected])
get-tsconfig: 4.7.2
globals: 13.24.0
ignore: 5.2.4
is-builtin-module: 3.2.1
is-core-module: 2.13.0
@@ -15295,7 +15322,7 @@ packages:
engines: {node: '>=5.0.0'}
dev: true
/[email protected]([email protected])([email protected])(vue-eslint-parser@9.3.2):
/[email protected]([email protected])([email protected])(vue-eslint-parser@9.4.2):
resolution: {integrity: sha512-F6XXcq4mKKUe/SREoMGQqzgw6cgCgf3pFzkFfQVIGtqD1yXVpQjnhTepzhBeZfxZwgMzR9HO4yH4CUhIQ2WBcQ==}
peerDependencies:
astro-eslint-parser: ^0.16.0
@@ -15317,22 +15344,39 @@ packages:
eslint: 8.54.0
minimatch: 9.0.3
natural-compare-lite: 1.4.0
vue-eslint-parser: 9.3.2([email protected])
vue-eslint-parser: 9.4.2([email protected])
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/eslint-plugin-[email protected]([email protected]):
resolution: {integrity: sha512-0fHEa/8Pih5cmzFW5L7xMEfUTvI9WKeQtjmKpTUmY+BiFCDxkxrTdnURJOHKykhtwIeyYsxnecbGvDCml++z4Q==}
/eslint-plugin-[email protected]([email protected]):
resolution: {integrity: sha512-ri0xf63PYf3pIq/WY9BIwrqxZmGTIwSkAO0bHddI0ajUwN4KGz6W8vOvdXFHOpRdRfzxlmXze/vfsY/aTEXESg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
debug: 4.3.4([email protected])
eslint: 8.54.0
eslint-compat-utils: 0.4.1([email protected])
lodash: 4.17.21
toml-eslint-parser: 0.9.3
transitivePeerDependencies:
- supports-color
dev: true
/[email protected]([email protected]):
resolution: {integrity: sha512-KxenCZxqSYW0GWHH18okDlOQcpezcitm5aOSz6EnobyJ6BIByiPDviQRjJIUAjG/tMN11958MxaQ+qCoU6lfDA==}
engines: {node: '>=16'}
peerDependencies:
eslint: '>=8.52.0'
eslint: '>=8.56.0'
dependencies:
'@babel/helper-validator-identifier': 7.22.20
'@eslint-community/eslint-utils': 4.4.0([email protected])
ci-info: 3.9.0
'@eslint/eslintrc': 2.1.4
ci-info: 4.0.0
clean-regexp: 1.0.0
core-js-compat: 3.35.1
eslint: 8.54.0
esquery: 1.5.0
indent-string: 4.0.0
@@ -15344,6 +15388,8 @@ packages:
regjsparser: 0.10.0
semver: 7.5.4
strip-indent: 3.0.0
transitivePeerDependencies:
- supports-color
dev: true
/[email protected](@typescript-eslint/[email protected])([email protected]):
@@ -15361,9 +15407,9 @@ packages:
eslint-rule-composer: 0.3.0
dev: true
/[email protected].9(@typescript-eslint/[email protected])([email protected])([email protected])(vitest@packages+vitest):
resolution: {integrity: sha512-ZGrz8dWFlotM5dwrsMLP4VcY5MizwKNV4JTnY0VKdnuCZ+qeEUMHf1qd8kRGQA3tqLvXcV929wt2ANkduq2Pgw==}
engines: {node: 14.x || >= 16}
/[email protected].22(@typescript-eslint/[email protected])([email protected])([email protected])(vitest@packages+vitest):
resolution: {integrity: sha512-atkFGQ7aVgcuSeSMDqnyevIyUpfBPMnosksgEPrKE7Y8xQlqG/5z2IQ6UDau05zXaaFv7Iz8uzqvIuKshjZ0Zw==}
engines: {node: ^18.0.0 || >= 20.0.0}
peerDependencies:
'@typescript-eslint/eslint-plugin': '*'
eslint: '>=8.0.0'
@@ -15375,7 +15421,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/[email protected])([email protected])([email protected])
'@typescript-eslint/utils': 6.10.0([email protected])([email protected])
'@typescript-eslint/utils': 6.21.0([email protected])([email protected])
eslint: 8.54.0
vitest: link:packages/vitest
transitivePeerDependencies:
@@ -15383,8 +15429,8 @@ packages:
- typescript
dev: true
/[email protected]8.1([email protected]):
resolution: {integrity: sha512-7hZFlrEgg9NIzuVik2I9xSnJA5RsmOfueYgsUGUokEDLJ1LHtxO0Pl4duje1BriZ/jDWb+44tcIlC3yi0tdlZg==}
/eslint-plugin-vue@9.21.1([email protected]):
resolution: {integrity: sha512-XVtI7z39yOVBFJyi8Ljbn7kY9yHzznKXL02qQYn+ta63Iy4A9JFBw6o4OSB9hyD2++tVT+su9kQqetUyCCwhjw==}
engines: {node: ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
@@ -15395,21 +15441,21 @@ packages:
nth-check: 2.1.1
postcss-selector-parser: 6.0.13
semver: 7.5.4
vue-eslint-parser: 9.3.2([email protected])
vue-eslint-parser: 9.4.2([email protected])
xml-name-validator: 4.0.0
transitivePeerDependencies:
- supports-color
dev: true
/[email protected]0.0([email protected]):
resolution: {integrity: sha512-53SUwuNDna97lVk38hL/5++WXDuugPM9SUQ1T645R0EHMRCdBIIxGye/oOX2qO3FQ7aImxaUZJU/ju+NMUBrLQ==}
/[email protected]2.2([email protected]):
resolution: {integrity: sha512-hvS9p08FhPT7i/ynwl7/Wt7ke7Rf4P2D6fT8lZlL43peZDTsHtH2A0SIFQ7Kt7+mJ6if6P+FX3iJhMkdnxQwpg==}
engines: {node: ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
debug: 4.3.4([email protected])
eslint: 8.54.0
eslint-compat-utils: 0.1.2([email protected])
eslint-compat-utils: 0.4.1([email protected])
lodash: 4.17.21
natural-compare: 1.4.0
yaml-eslint-parser: 1.2.2
@@ -15417,6 +15463,16 @@ packages:
- supports-color
dev: true
/[email protected](@vue/[email protected])([email protected]):
resolution: {integrity: sha512-9+dU5lU881log570oBwpelaJmOfOzSniben7IWEDRYQPPWwlvaV7NhOtsTuUWDqpYT+dtKKWPsgz4OkOi+aZnA==}
peerDependencies:
'@vue/compiler-sfc': ^3.3.0
eslint: ^8.50.0
dependencies:
'@vue/compiler-sfc': 3.4.5
eslint: 8.54.0
dev: true
/[email protected]:
resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==}
engines: {node: '>=4.0.0'}
@@ -16911,6 +16967,13 @@ packages:
type-fest: 0.20.2
dev: true
/[email protected]:
resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
dev: true
/[email protected]:
resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==}
engines: {node: '>= 0.4'}
@@ -19361,7 +19424,7 @@ packages:
resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
acorn: 8.11.2
acorn: 8.11.3
eslint-visitor-keys: 3.4.3
espree: 9.6.1
semver: 7.5.4
@@ -20780,6 +20843,10 @@ packages:
/[email protected]:
resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
/[email protected]:
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
dev: true
/[email protected]:
resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -23415,6 +23482,14 @@ packages:
dependencies:
lru-cache: 6.0.0
/[email protected]:
resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/[email protected]:
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
engines: {node: '>= 0.8.0'}
@@ -23896,6 +23971,13 @@ packages:
spdx-license-ids: 3.0.12
dev: true
/[email protected]:
resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==}
dependencies:
spdx-exceptions: 2.3.0
spdx-license-ids: 3.0.12
dev: true
/[email protected]:
resolution: {integrity: sha512-b3wydZLM+Tc6CFvaRDBOF9d76oGIHNCLYFeHbftFXUWjnfZWganmDmvtM5sm1cRwJc/VDBMLyGGrsLFd1vOxbg==}
dependencies:
@@ -24614,6 +24696,13 @@ packages:
resolution: {integrity: sha512-AsS729u2RHUfEra9xJrE39peJcc2stq2+poBXX8bcM08Y6g9j/i/PUzwNQqkaJde7Ntg1TO7bSREbR5sdosQ+g==}
dev: true
/[email protected]:
resolution: {integrity: sha512-Vhf+bUa//YSTYKseDiiEuQmhGCoIF3CVBhunm3r/DQnYiGT4JssmnKQc44BIyOZRK2pKjXXAgbhfmbeoC9CJpA==}
engines: {node: '>=12.20'}
dependencies:
tslib: 2.5.3
dev: true
/[email protected]:
resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==}
dev: true
@@ -25001,6 +25090,13 @@ packages:
engines: {node: '>=0.6'}
dev: true
/[email protected]:
resolution: {integrity: sha512-moYoCvkNUAPCxSW9jmHmRElhm4tVJpHL8ItC/+uYD0EpPSFXbck7yREz9tNdJVTSpHVod8+HoipcpbQ0oE6gsw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
eslint-visitor-keys: 3.4.3
dev: true
/[email protected]:
resolution: {integrity: sha512-eM+pCBxXO/njtF7vdFsHuqb+ElbxqtI4r5EAvk6grfAFyJ6IvWlSkfZ5T9ozC6xWw3Fj1fGoSmrl0gUs46JVIw==}
engines: {node: '>=6'}
@@ -25679,6 +25775,17 @@ packages:
escalade: 3.1.1
picocolors: 1.0.0
/[email protected]([email protected]):
resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
dependencies:
browserslist: 4.22.3
escalade: 3.1.1
picocolors: 1.0.0
dev: true
/[email protected]:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
@@ -25882,7 +25989,7 @@ packages:
vfile-message: 2.0.4
dev: true
/[email protected]([email protected]):
/[email protected](@vue/[email protected])([email protected]):
resolution: {integrity: sha512-fw3onBfVTXQI7rOzAbSZhmfwvk50+3qNnGZpERjmD93c8nEjrGLyd53eFXYMxcJV4KA1vzi4qIHt2+6tS4dEMw==}
peerDependencies:
'@vue/compiler-sfc': ^2.7.0 || ^3.0.0
@@ -25892,6 +25999,7 @@ packages:
optional: true
dependencies:
'@types/debug': 4.1.12
'@vue/compiler-sfc': 3.4.5
debug: 4.3.4([email protected])
deep-equal: 2.2.1
extract-comments: 1.1.0
@@ -26165,8 +26273,8 @@ packages:
vue: 3.4.5([email protected])
dev: true
/vue-eslint-parser@9.3.2([email protected]):
resolution: {integrity: sha512-q7tWyCVaV9f8iQyIA5Mkj/S6AoJ9KBN8IeUSf3XEmBrOtxOZnfTg5s4KClbZBCK3GtnT/+RyCLZyDHuZwTuBjg==}
/vue-eslint-parser@9.4.2([email protected]):
resolution: {integrity: sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==}
engines: {node: ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
+5 -5
View File
@@ -9,10 +9,10 @@ class TestError extends Error {}
// For expect.extend
interface CustomMatchers<R = unknown> {
toBeDividedBy(divisor: number): R
toBeTestedAsync(): Promise<R>
toBeTestedSync(): R
toBeTestedPromise(): R
toBeDividedBy: (divisor: number) => R
toBeTestedAsync: () => Promise<R>
toBeTestedSync: () => R
toBeTestedPromise: () => R
}
declare module 'vitest' {
@@ -24,7 +24,7 @@ declare global {
// eslint-disable-next-line ts/no-namespace
namespace jest {
interface Matchers<R> {
toBeJestCompatible(): R
toBeJestCompatible: () => R
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ import { assertTypes, deepClone, objectAttr, toArray } from '@vitest/utils'
import { deepMerge, resetModules } from '../../../packages/vitest/src/utils'
import { deepMergeSnapshot } from '../../../packages/snapshot/src/port/utils'
import type { EncodedSourceMap } from '../../../packages/vite-node/src/types'
import { ModuleCacheMap } from '../../../packages/vite-node/dist/client'
import { ModuleCacheMap } from '../../../packages/vite-node/src/client'
describe('assertTypes', () => {
test('the type of value should be number', () => {
+1 -1
View File
@@ -52,7 +52,7 @@ class CustomCoverageProvider implements CoverageProvider {
this.calls.add(`initialized ${ctx ? 'with' : 'without'} context`)
}
clean(force: boolean) {
clean(force?: boolean) {
this.calls.add(`clean ${force ? 'with' : 'without'} force`)
}
@@ -120,7 +120,7 @@ test('provider module', () => {
processingConcurrency: 1,
}
},
clean(_: boolean) {},
clean(_?: boolean) {},
onBeforeFilesRun() {},
onAfterSuiteRun({ coverage: _coverage }) {},
reportCoverage() {},