diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea2a4105efec..a3e2715e0a3a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,6 +37,8 @@ jobs: - name: Build run: pnpm build + env: + NO_VITE_TEST_WATCHER_DEBUG: '1' - name: Publish to npm run: pnpm run publish-ci ${{ github.ref_name }} diff --git a/.gitignore b/.gitignore index e6fecff012e2..67e90a1a3058 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ dist ltex* .DS_Store bench/test/*/*/ -**/benchmark/bench.json +**/bench.json **/browser/browser.json cypress/videos cypress/downloads diff --git a/docs/.vitepress/sponsors.ts b/docs/.vitepress/sponsors.ts index 13835a9b618f..facb3c251394 100644 --- a/docs/.vitepress/sponsors.ts +++ b/docs/.vitepress/sponsors.ts @@ -34,13 +34,7 @@ const vitestSponsors = { img: '/bit.svg', }, ], - gold: [ - { - name: 'InfoSupport', - url: 'https://www.infosupport.com/open-source/', - img: '/infosupport.svg', - }, - ], + // gold: [], } satisfies Record export const sponsors = [ @@ -54,9 +48,9 @@ export const sponsors = [ size: 'big', items: vitestSponsors.platinum, }, - { - tier: 'Gold Sponsors', - size: 'medium', - items: vitestSponsors.gold, - }, + // { + // tier: 'Gold Sponsors', + // size: 'medium', + // items: vitestSponsors.gold, + // }, ] diff --git a/docs/config/index.md b/docs/config/index.md index c0d73e06e1ae..7d1f011d2541 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -1103,6 +1103,20 @@ List of files included in coverage as glob patterns List of files excluded from coverage as glob patterns. +This option overrides all default options. Extend the default options when adding new patterns to ignore: + +```ts +import { coverageConfigDefaults, defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + coverage: { + exclude: ['**/custom-pattern/**', ...coverageConfigDefaults.exclude] + }, + }, +}) +``` + #### coverage.all - **Type:** `boolean` @@ -1320,6 +1334,38 @@ Sets thresholds for files matching the glob pattern. } ``` +#### coverage.ignoreEmptyLines + +- **Type:** `boolean` +- **Default:** `false` +- **Available for providers:** `'v8'` +- **CLI:** `--coverage.ignoreEmptyLines=` + +Ignore empty lines, comments and other non-runtime code, e.g. Typescript types. + +This option works only if the used compiler removes comments and other non-runtime code from the transpiled code. +By default Vite uses ESBuild which removes comments and Typescript types from `.ts`, `.tsx` and `.jsx` files. + +If you want to apply ESBuild to other files as well, define them in [`esbuild` options](https://vitejs.dev/config/shared-options.html#esbuild): + +```ts +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + esbuild: { + // Transpile all files with ESBuild to remove comments from code coverage. + // Required for `test.coverage.ignoreEmptyLines` to work: + include: ['**/*.js', '**/*.jsx', '**/*.mjs', '**/*.ts', '**/*.tsx'], + }, + test: { + coverage: { + provider: 'v8', + ignoreEmptyLines: true, + }, + }, +}) +``` + #### coverage.ignoreClassMethods - **Type:** `string[]` @@ -2031,6 +2077,28 @@ export default defineConfig({ ``` ::: +#### diff.truncateThreshold + +- **Type**: `number` +- **Default**: `0` + +The maximum length of diff result to be displayed. Diffs above this threshold will be truncated. +Truncation won't take effect with default value 0. + +#### diff.truncateAnnotation + +- **Type**: `string` +- **Default**: `'... Diff result is truncated'` + +Annotation that is output at the end of diff result if it's truncated. + +#### diff.truncateAnnotationColor + +- **Type**: `DiffOptionsColor = (arg: string) => string` +- **Default**: `noColor = (string: string): string => string` + +Color of truncate annotation, default is output with no color. + ### fakeTimers - **Type:** `FakeTimerInstallOpts` diff --git a/docs/guide/coverage.md b/docs/guide/coverage.md index e160ed9875d4..09f1c59d3cab 100644 --- a/docs/guide/coverage.md +++ b/docs/guide/coverage.md @@ -43,6 +43,11 @@ npm i -D @vitest/coverage-istanbul ## Coverage Setup +:::tip +It's recommended to always define [`coverage.include`](https://vitest.dev/config/#coverage-include) in your configuration file. +This helps Vitest to reduce the amount of files picked by [`coverage.all`](https://vitest.dev/config/#coverage-all). +::: + To test with coverage enabled, you can pass the `--coverage` flag in CLI. By default, reporter `['text', 'html', 'clover', 'json']` will be used. diff --git a/package.json b/package.json index 882ad9bc6b0a..25aefad69552 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "simple-git-hooks": "^2.9.0", "tsx": "^4.6.1", "typescript": "^5.2.2", - "vite": "^5.0.12", + "vite": "^5.2.6", "vitest": "workspace:*", "zx": "^7.2.3" }, @@ -85,7 +85,8 @@ "@types/chai@4.3.6": "patches/@types__chai@4.3.6.patch", "@sinonjs/fake-timers@11.1.0": "patches/@sinonjs__fake-timers@11.1.0.patch", "cac@6.7.14": "patches/cac@6.7.14.patch", - "@types/sinonjs__fake-timers@8.1.5": "patches/@types__sinonjs__fake-timers@8.1.5.patch" + "@types/sinonjs__fake-timers@8.1.5": "patches/@types__sinonjs__fake-timers@8.1.5.patch", + "v8-to-istanbul@9.2.0": "patches/v8-to-istanbul@9.2.0.patch" } }, "simple-git-hooks": { diff --git a/packages/coverage-v8/package.json b/packages/coverage-v8/package.json index 33cf11cae857..2b961d62e944 100644 --- a/packages/coverage-v8/package.json +++ b/packages/coverage-v8/package.json @@ -56,8 +56,7 @@ "picocolors": "^1.0.0", "std-env": "^3.5.0", "strip-literal": "^2.0.0", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.2.0" + "test-exclude": "^6.0.0" }, "devDependencies": { "@types/debug": "^4.1.12", @@ -66,6 +65,7 @@ "@types/istanbul-lib-source-maps": "^4.0.4", "@types/istanbul-reports": "^3.0.4", "pathe": "^1.1.1", + "v8-to-istanbul": "^9.2.0", "vite-node": "workspace:*", "vitest": "workspace:*" } diff --git a/packages/coverage-v8/src/provider.ts b/packages/coverage-v8/src/provider.ts index 3f43c74ec131..be1805020c46 100644 --- a/packages/coverage-v8/src/provider.ts +++ b/packages/coverage-v8/src/provider.ts @@ -266,14 +266,12 @@ export class V8CoverageProvider extends BaseCoverageProvider implements Coverage } const coverages = await Promise.all(chunk.map(async (filename) => { - const transformResult = await this.ctx.vitenode.transformRequest(filename.pathname).catch(() => {}) + const { originalSource, source } = await this.getSources(filename.href, transformResults) // Ignore empty files, e.g. files that contain only typescript types and no runtime code - if (transformResult && stripLiteral(transformResult.code).trim() === '') + if (source && stripLiteral(source).trim() === '') return null - const { originalSource } = await this.getSources(filename.href, transformResults) - const coverage = { url: filename.href, scriptId: '0', @@ -309,9 +307,9 @@ export class V8CoverageProvider extends BaseCoverageProvider implements Coverage }> { const filePath = normalize(fileURLToPath(url)) - const transformResult = transformResults.get(filePath) + const transformResult = transformResults.get(filePath) || await this.ctx.vitenode.transformRequest(filePath).catch(() => {}) - const map = transformResult?.map + const map = transformResult?.map as (EncodedSourceMap | undefined) const code = transformResult?.code const sourcesContent = map?.sourcesContent?.[0] || await fs.readFile(filePath, 'utf-8').catch(() => { // If file does not exist construct a dummy source for it. @@ -367,7 +365,7 @@ export class V8CoverageProvider extends BaseCoverageProvider implements Coverage // If no source map was found from vite-node we can assume this file was not run in the wrapper const wrapperLength = sources.sourceMap ? WRAPPER_LENGTH : 0 - const converter = v8ToIstanbul(url, wrapperLength, sources) + const converter = v8ToIstanbul(url, wrapperLength, sources, undefined, this.options.ignoreEmptyLines) await converter.load() converter.applyCoverage(functions) diff --git a/packages/utils/src/diff/diffLines.ts b/packages/utils/src/diff/diffLines.ts index 014b8d1d9d87..df514495dd3d 100644 --- a/packages/utils/src/diff/diffLines.ts +++ b/packages/utils/src/diff/diffLines.ts @@ -81,21 +81,24 @@ function printAnnotation({ return `${aColor(a)}\n${bColor(b)}\n\n` } -export function printDiffLines(diffs: Array, options: DiffOptionsNormalized): string { +export function printDiffLines(diffs: Array, truncated: boolean, options: DiffOptionsNormalized): string { return printAnnotation(options, countChanges(diffs)) - + (options.expand - ? joinAlignedDiffsExpand(diffs, options) - : joinAlignedDiffsNoExpand(diffs, options)) + + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options)) + + (truncated ? options.truncateAnnotationColor(`\n${options.truncateAnnotation}`) : '') } // Compare two arrays of strings line-by-line. Format as comparison lines. export function diffLinesUnified(aLines: Array, bLines: Array, options?: DiffOptions): string { + const normalizedOptions = normalizeDiffOptions(options) + const [diffs, truncated] = diffLinesRaw( + isEmptyString(aLines) ? [] : aLines, + isEmptyString(bLines) ? [] : bLines, + normalizedOptions, + ) return printDiffLines( - diffLinesRaw( - isEmptyString(aLines) ? [] : aLines, - isEmptyString(bLines) ? [] : bLines, - ), - normalizeDiffOptions(options), + diffs, + truncated, + normalizedOptions, ) } @@ -120,7 +123,7 @@ export function diffLinesUnified2(aLinesDisplay: Array, bLinesDisplay: A return diffLinesUnified(aLinesDisplay, bLinesDisplay, options) } - const diffs = diffLinesRaw(aLinesCompare, bLinesCompare) + const [diffs, truncated] = diffLinesRaw(aLinesCompare, bLinesCompare, options) // Replace comparison lines with displayable lines. let aIndex = 0 @@ -144,13 +147,16 @@ export function diffLinesUnified2(aLinesDisplay: Array, bLinesDisplay: A } }) - return printDiffLines(diffs, normalizeDiffOptions(options)) + return printDiffLines(diffs, truncated, normalizeDiffOptions(options)) } // Compare two arrays of strings line-by-line. -export function diffLinesRaw(aLines: Array, bLines: Array): Array { - const aLength = aLines.length - const bLength = bLines.length +export function diffLinesRaw(aLines: Array, bLines: Array, options?: DiffOptions): [Array, boolean] { + const truncate = options?.truncateThreshold ?? false + const truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0) + const aLength = truncate ? Math.min(aLines.length, truncateThreshold) : aLines.length + const bLength = truncate ? Math.min(bLines.length, truncateThreshold) : bLines.length + const truncated = aLength !== aLines.length || bLength !== bLines.length const isCommon = (aIndex: number, bIndex: number) => aLines[aIndex] === bLines[bIndex] @@ -185,5 +191,5 @@ export function diffLinesRaw(aLines: Array, bLines: Array): Arra for (; bIndex !== bLength; bIndex += 1) diffs.push(new Diff(DIFF_INSERT, bLines[bIndex])) - return diffs + return [diffs, truncated] } diff --git a/packages/utils/src/diff/diffStrings.ts b/packages/utils/src/diff/diffStrings.ts index 706f001fee97..3346fc6e63f2 100644 --- a/packages/utils/src/diff/diffStrings.ts +++ b/packages/utils/src/diff/diffStrings.ts @@ -7,8 +7,31 @@ import * as diff from 'diff-sequences' import { DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff } from './cleanupSemantic' +import type { DiffOptions } from './types' + +// platforms compatible +function getNewLineSymbol(string: string) { + return string.includes('\r\n') ? '\r\n' : '\n' +} + +function diffStrings(a: string, b: string, options?: DiffOptions): [Array, boolean] { + const truncate = options?.truncateThreshold ?? false + const truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0) + let aLength = a.length + let bLength = b.length + if (truncate) { + const aMultipleLines = a.includes('\n') + const bMultipleLines = b.includes('\n') + const aNewLineSymbol = getNewLineSymbol(a) + const bNewLineSymbol = getNewLineSymbol(b) + // multiple-lines string expects a newline to be appended at the end + const _a = aMultipleLines ? `${a.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}\n` : a + const _b = bMultipleLines ? `${b.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}\n` : b + aLength = _a.length + bLength = _b.length + } + const truncated = aLength !== a.length || bLength !== b.length -function diffStrings(a: string, b: string): Array { const isCommon = (aIndex: number, bIndex: number) => a[aIndex] === b[bIndex] let aIndex = 0 @@ -34,16 +57,16 @@ function diffStrings(a: string, b: string): Array { // @ts-expect-error wrong bundling const diffSequences = diff.default.default || diff.default - diffSequences(a.length, b.length, isCommon, foundSubsequence) + diffSequences(aLength, bLength, isCommon, foundSubsequence) // After the last common subsequence, push remaining change items. - if (aIndex !== a.length) + if (aIndex !== aLength) diffs.push(new Diff(DIFF_DELETE, a.slice(aIndex))) - if (bIndex !== b.length) + if (bIndex !== bLength) diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex))) - return diffs + return [diffs, truncated] } export default diffStrings diff --git a/packages/utils/src/diff/normalizeDiffOptions.ts b/packages/utils/src/diff/normalizeDiffOptions.ts index 8cf6d530294d..d06079f0daca 100644 --- a/packages/utils/src/diff/normalizeDiffOptions.ts +++ b/packages/utils/src/diff/normalizeDiffOptions.ts @@ -12,6 +12,7 @@ import type { DiffOptions, DiffOptionsNormalized } from './types' export const noColor = (string: string): string => string const DIFF_CONTEXT_DEFAULT = 5 +const DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0 // not truncate function getDefaultOptions(): DiffOptionsNormalized { const c = getColors() @@ -35,6 +36,9 @@ function getDefaultOptions(): DiffOptionsNormalized { includeChangeCounts: false, omitAnnotationLines: false, patchColor: c.yellow, + truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT, + truncateAnnotation: '... Diff result is truncated', + truncateAnnotationColor: noColor, } } diff --git a/packages/utils/src/diff/printDiffs.ts b/packages/utils/src/diff/printDiffs.ts index f72e24eb18f5..2254267e9dc7 100644 --- a/packages/utils/src/diff/printDiffs.ts +++ b/packages/utils/src/diff/printDiffs.ts @@ -32,16 +32,17 @@ export function diffStringsUnified(a: string, b: string, options?: DiffOptions): const isMultiline = a.includes('\n') || b.includes('\n') // getAlignedDiffs assumes that a newline was appended to the strings. - const diffs = diffStringsRaw( + const [diffs, truncated] = diffStringsRaw( isMultiline ? `${a}\n` : a, isMultiline ? `${b}\n` : b, true, // cleanupSemantic + options, ) if (hasCommonDiff(diffs, isMultiline)) { const optionsNormalized = normalizeDiffOptions(options) const lines = getAlignedDiffs(diffs, optionsNormalized.changeColor) - return printDiffLines(lines, optionsNormalized) + return printDiffLines(lines, truncated, optionsNormalized) } } @@ -51,11 +52,11 @@ export function diffStringsUnified(a: string, b: string, options?: DiffOptions): // Compare two strings character-by-character. // Optionally clean up small common substrings, also known as chaff. -export function diffStringsRaw(a: string, b: string, cleanup: boolean): Array { - const diffs = diffStrings(a, b) +export function diffStringsRaw(a: string, b: string, cleanup: boolean, options?: DiffOptions): [Array, boolean] { + const [diffs, truncated] = diffStrings(a, b, options) if (cleanup) cleanupSemantic(diffs) // impure function - return diffs + return [diffs, truncated] } diff --git a/packages/utils/src/diff/types.ts b/packages/utils/src/diff/types.ts index c7b984fd9fad..d962c5eacc4f 100644 --- a/packages/utils/src/diff/types.ts +++ b/packages/utils/src/diff/types.ts @@ -27,6 +27,9 @@ export interface DiffOptions { omitAnnotationLines?: boolean patchColor?: DiffOptionsColor compareKeys?: CompareKeys + truncateThreshold?: number + truncateAnnotation?: string + truncateAnnotationColor?: DiffOptionsColor } export interface DiffOptionsNormalized { @@ -48,4 +51,7 @@ export interface DiffOptionsNormalized { includeChangeCounts: boolean omitAnnotationLines: boolean patchColor: DiffOptionsColor + truncateThreshold: number + truncateAnnotation: string + truncateAnnotationColor: DiffOptionsColor } diff --git a/packages/utils/src/helpers.ts b/packages/utils/src/helpers.ts index 5a3b454a8d8b..40effb2a3836 100644 --- a/packages/utils/src/helpers.ts +++ b/packages/utils/src/helpers.ts @@ -111,7 +111,15 @@ export function clone( if (!descriptor) continue const cloned = clone((val as any)[k], seen, options) - if ('get' in descriptor) { + if (options.forceWritable) { + Object.defineProperty(out, k, { + enumerable: descriptor.enumerable, + configurable: true, + writable: true, + value: cloned, + }) + } + else if ('get' in descriptor) { Object.defineProperty(out, k, { ...descriptor, get() { @@ -122,7 +130,6 @@ export function clone( else { Object.defineProperty(out, k, { ...descriptor, - writable: options.forceWritable ? true : descriptor.writable, value: cloned, }) } diff --git a/packages/vite-node/rollup.config.js b/packages/vite-node/rollup.config.js index b9f3d7712c92..3ba627fa3e97 100644 --- a/packages/vite-node/rollup.config.js +++ b/packages/vite-node/rollup.config.js @@ -41,6 +41,10 @@ const plugins = [ commonjs(), esbuild({ target: 'node14', + define: + process.env.NO_VITE_TEST_WATCHER_DEBUG + ? { 'process.env.VITE_TEST_WATCHER_DEBUG': 'false' } + : {}, }), ] diff --git a/packages/vite-node/src/cli.ts b/packages/vite-node/src/cli.ts index 39b16b0963f3..8d94836a8a61 100644 --- a/packages/vite-node/src/cli.ts +++ b/packages/vite-node/src/cli.ts @@ -131,6 +131,31 @@ async function run(files: string[], options: CliOptions = {}) { process.on('uncaughtException', (err) => { console.error(c.red('[vite-node] Failed to execute file: \n'), err) }) + + if (process.env.VITE_TEST_WATCHER_DEBUG) { + // manually check `watcher.getWatched()` to make sure entry files are ready + // since watcher.on('ready', ...) event is not reliable since 5.1. + // https://github.com/vitejs/vite/blob/63a39c244b08cf1f2299bc2c3cfddcb82070d05b/playground/hmr-ssr/__tests__/hmr.spec.ts#L1065 + + const nodePath = await import('node:path') + + async function waitForWatched(files: string[]): Promise { + while (!files.every(file => isWatched(file))) + await new Promise(resolve => setTimeout(resolve, 20)) + } + + function isWatched(file: string): boolean { + const watched = server.watcher.getWatched() + const resolved = nodePath.resolve(file) + const dir = nodePath.dirname(resolved) + const base = nodePath.basename(resolved) + return watched[dir]?.includes(base) + } + + await waitForWatched(files) + // eslint-disable-next-line no-console + console.log('[debug] watcher is ready') + } } } diff --git a/packages/vite-node/src/hmr/emitter.ts b/packages/vite-node/src/hmr/emitter.ts index 06afe9862987..8295d536438a 100644 --- a/packages/vite-node/src/hmr/emitter.ts +++ b/packages/vite-node/src/hmr/emitter.ts @@ -50,12 +50,6 @@ export function viteNodeHmrPlugin(): Plugin { _send(payload) emitter.emit('message', payload) } - if (process.env.VITE_TEST_WATCHER_DEBUG) { - server.watcher.on('ready', () => { - // eslint-disable-next-line no-console - console.log('[debug] watcher is ready') - }) - } }, } } diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index 44d21c4a350f..ae678886bf75 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -43,6 +43,7 @@ export const coverageConfigDefaults: ResolvedCoverageOptions = { reporter: [['text', {}], ['html', {}], ['clover', {}], ['json', {}]], extension: ['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte', '.marko'], allowExternal: false, + ignoreEmptyLines: false, processingConcurrency: Math.min(20, os.availableParallelism?.() ?? os.cpus().length), } diff --git a/packages/vitest/src/node/config.ts b/packages/vitest/src/node/config.ts index 9d1c96a18fa3..26d82b7fa1c1 100644 --- a/packages/vitest/src/node/config.ts +++ b/packages/vitest/src/node/config.ts @@ -119,7 +119,8 @@ export function resolveConfig( if (resolved.minWorkers) resolved.minWorkers = Number(resolved.minWorkers) - resolved.fileParallelism ??= true + // run benchmark sequentially by default + resolved.fileParallelism ??= mode !== 'benchmark' if (!resolved.fileParallelism) { // ignore user config, parallelism cannot be implemented without limiting workers diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 18146a0c1e4f..d53f88f48366 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -1,4 +1,5 @@ import { existsSync, promises as fs } from 'node:fs' +import { isMainThread } from 'node:worker_threads' import type { ViteDevServer } from 'vite' import { mergeConfig } from 'vite' import { basename, dirname, join, normalize, relative, resolve } from 'pathe' @@ -312,23 +313,50 @@ export class Vitest { return acc }, {} as UserConfig) - const projects = filteredWorkspaces.map(async (workspacePath) => { - // don't start a new server, but reuse existing one - if ( - this.server.config.configFile === workspacePath - ) - return this.createCoreProject() - return initializeProject(workspacePath, this, { workspaceConfigPath, test: cliOverrides }) - }) + const cwd = process.cwd() + + const projects: (() => Promise)[] = [] + + try { + // we have to resolve them one by one because CWD should depend on the project + for (const filepath of filteredWorkspaces) { + if (this.server.config.configFile === filepath) { + const project = await this.createCoreProject() + projects.push(() => Promise.resolve(project)) + continue + } + const dir = filepath.endsWith('/') ? filepath.slice(0, -1) : dirname(filepath) + if (isMainThread) + process.chdir(dir) + // this just resolves the config, later we also wait when the server is resolved, + // but we can do that in parallel because it doesn't depend on process.cwd() + // this is strictly a performance optimization so we don't need to wait for server to start + projects.push(await initializeProject(filepath, this, { workspaceConfigPath, test: cliOverrides })) + } + } + finally { + if (isMainThread) + process.chdir(cwd) + } + + const projectPromises: Promise<() => Promise>[] = [] projectsOptions.forEach((options, index) => { - projects.push(initializeProject(index, this, mergeConfig(options, { workspaceConfigPath, test: cliOverrides }) as any)) + // we can resolve these in parallel because process.cwd() is not changed + projectPromises.push(initializeProject(index, this, mergeConfig(options, { workspaceConfigPath, test: cliOverrides }) as any)) }) - if (!projects.length) + if (!projects.length && !projectPromises.length) return [await this.createCoreProject()] - const resolvedProjects = await Promise.all(projects) + const resolvedProjectsReceivers = [ + ...projects, + ...await Promise.all(projectPromises), + ] + // we need to wait when the server is resolved, we can do that in parallel + const resolvedProjects = await Promise.all( + resolvedProjectsReceivers.map(receiver => receiver()), + ) const names = new Set() for (const project of resolvedProjects) { diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index bde767865e39..f1b149b76378 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -328,8 +328,12 @@ export abstract class BaseReporter implements Reporter { const groupName = getFullName(group, c.dim(' > ')) logger.log(` ${bench.name}${c.dim(` - ${groupName}`)}`) const siblings = group.tasks - .filter(i => i.result?.benchmark && i !== bench) + .filter(i => i.meta.benchmark && i.result?.benchmark && i !== bench) .sort((a, b) => a.result!.benchmark!.rank - b.result!.benchmark!.rank) + if (siblings.length === 0) { + logger.log('') + continue + } for (const sibling of siblings) { const number = `${(sibling.result!.benchmark!.mean / bench.result!.benchmark!.mean).toFixed(2)}x` logger.log(` ${c.green(number)} ${c.gray('faster than')} ${sibling.name}`) diff --git a/packages/vitest/src/node/reporters/benchmark/table/index.ts b/packages/vitest/src/node/reporters/benchmark/table/index.ts index 751e2431717a..a7fa9fae5f05 100644 --- a/packages/vitest/src/node/reporters/benchmark/table/index.ts +++ b/packages/vitest/src/node/reporters/benchmark/table/index.ts @@ -1,7 +1,10 @@ import c from 'picocolors' +import type { TaskResultPack } from '@vitest/runner' import type { UserConsoleLog } from '../../../../types/general' import { BaseReporter } from '../../base' -import { type TableRendererOptions, createTableRenderer } from './tableRender' +import { getFullName } from '../../../../utils' +import { getStateSymbol } from '../../renderers/utils' +import { type TableRendererOptions, createTableRenderer, renderTree } from './tableRender' export class TableReporter extends BaseReporter { renderer?: ReturnType @@ -30,6 +33,25 @@ export class TableReporter extends BaseReporter { } } + onTaskUpdate(packs: TaskResultPack[]) { + if (this.isTTY) + return + for (const pack of packs) { + const task = this.ctx.state.idMap.get(pack[0]) + if (task && task.type === 'suite' && task.result?.state && task.result?.state !== 'run') { + // render static table when all benches inside single suite are finished + const benches = task.tasks.filter(t => t.meta.benchmark) + if (benches.length > 0 && benches.every(t => t.result?.state !== 'run')) { + let title = ` ${getStateSymbol(task)} ${getFullName(task, c.dim(' > '))}` + if (task.result.duration != null && task.result.duration > this.ctx.config.slowTestThreshold) + title += c.yellow(` ${Math.round(task.result.duration)}${c.dim('ms')}`) + this.ctx.logger.log(title) + this.ctx.logger.log(renderTree(benches, this.rendererOptions, 1, true)) + } + } + } + } + async onFinished(files = this.ctx.state.getFiles(), errors = this.ctx.state.getUnhandledErrors()) { await this.stopListRender() this.ctx.logger.log() diff --git a/packages/vitest/src/node/reporters/benchmark/table/tableRender.ts b/packages/vitest/src/node/reporters/benchmark/table/tableRender.ts index ee7b17c48be3..ceeac1327e6f 100644 --- a/packages/vitest/src/node/reporters/benchmark/table/tableRender.ts +++ b/packages/vitest/src/node/reporters/benchmark/table/tableRender.ts @@ -100,7 +100,7 @@ function renderBenchmark(task: Benchmark, tasks: Task[]): string { ].join(' ') } -function renderTree(tasks: Task[], options: TableRendererOptions, level = 0): string { +export function renderTree(tasks: Task[], options: TableRendererOptions, level = 0, shallow = false): string { const output: string[] = [] let idx = 0 @@ -151,7 +151,7 @@ function renderTree(tasks: Task[], options: TableRendererOptions, level = 0): st } } - if (task.type === 'suite' && task.tasks.length > 0) { + if (!shallow && task.type === 'suite' && task.tasks.length > 0) { if (task.result?.state) output.push(renderTree(task.tasks, options, level + 1)) } diff --git a/packages/vitest/src/node/workspace.ts b/packages/vitest/src/node/workspace.ts index b73f438ce4fa..c9df549c8324 100644 --- a/packages/vitest/src/node/workspace.ts +++ b/packages/vitest/src/node/workspace.ts @@ -1,7 +1,7 @@ import { promises as fs } from 'node:fs' import fg from 'fast-glob' import mm from 'micromatch' -import { dirname, join, relative, resolve, toNamespacedPath } from 'pathe' +import { dirname, isAbsolute, join, relative, resolve, toNamespacedPath } from 'pathe' import type { TransformResult, ViteDevServer, InlineConfig as ViteInlineConfig } from 'vite' import { ViteNodeRunner } from 'vite-node/client' import { ViteNodeServer } from 'vite-node/server' @@ -12,6 +12,7 @@ import { deepMerge } from '../utils' import type { Typechecker } from '../typecheck/typechecker' import type { BrowserProvider } from '../types/browser' import { getBrowserProvider } from '../integrations/browser' +import { createDefer } from '../public/utils' import { isBrowserEnabled, resolveConfig } from './config' import { WorkspaceVitestPlugin } from './plugins/workspace' import { createViteServer } from './vite' @@ -39,22 +40,40 @@ export async function initializeProject(workspacePath: string | number, ctx: Vit : workspacePath.endsWith('/') ? workspacePath : dirname(workspacePath) ) - const config: ViteInlineConfig = { - ...options, - root, - logLevel: 'error', - configFile, - // this will make "mode": "test" | "benchmark" inside defineConfig - mode: options.test?.mode || options.mode || ctx.config.mode, - plugins: [ - ...options.plugins || [], - WorkspaceVitestPlugin(project, { ...options, root, workspacePath }), - ], - } + return new Promise<() => Promise>((resolve, reject) => { + const resolution = createDefer() + let configResolved = false + const config: ViteInlineConfig = { + ...options, + root, + logLevel: 'error', + configFile, + // this will make "mode": "test" | "benchmark" inside defineConfig + mode: options.test?.mode || options.mode || ctx.config.mode, + plugins: [ + { + name: 'vitest:workspace:resolve', + configResolved() { + configResolved = true + resolve(() => resolution) + }, + }, + ...options.plugins || [], + WorkspaceVitestPlugin(project, { ...options, root, workspacePath }), + ], + } - await createViteServer(config) + createViteServer(config) + .then(() => resolution.resolve(project)) + .catch((err) => { + if (configResolved) + resolution.reject(err) + else + reject(err) + }) - return project + return project + }) } export class WorkspaceProject { @@ -257,7 +276,7 @@ export class WorkspaceProject { return code.includes('import.meta.vitest') } - filterFiles(testFiles: string[], filters: string[] = [], dir: string) { + filterFiles(testFiles: string[], filters: string[], dir: string) { if (filters.length && process.platform === 'win32') filters = filters.map(f => toNamespacedPath(f)) @@ -266,6 +285,16 @@ export class WorkspaceProject { const testFile = relative(dir, t).toLocaleLowerCase() return filters.some((f) => { const relativePath = f.endsWith('/') ? join(relative(dir, f), '/') : relative(dir, f) + + // if filter is a full file path, we should include it if it's in the same folder + if (isAbsolute(f)) { + // the file is inside the filter path, so we should always include it, + // we don't include ../file because this condition is always true if + // the file doens't exist which cause false positives + if (relativePath === '..' || relativePath === '../' || relativePath.startsWith('../..')) + return true + } + return testFile.includes(f.toLocaleLowerCase()) || testFile.includes(relativePath.toLocaleLowerCase()) }) }) @@ -383,6 +412,10 @@ export class WorkspaceProject { inspectBrk: this.ctx.config.inspectBrk, alias: [], includeTaskLocation: this.config.includeTaskLocation ?? this.ctx.config.includeTaskLocation, + env: { + ...this.server?.config.env, + ...this.config.env, + }, }, this.ctx.configOverride || {} as any) as ResolvedConfig } diff --git a/packages/vitest/src/runtime/runners/benchmark.ts b/packages/vitest/src/runtime/runners/benchmark.ts index 87838b007153..a72a6a232ef1 100644 --- a/packages/vitest/src/runtime/runners/benchmark.ts +++ b/packages/vitest/src/runtime/runners/benchmark.ts @@ -35,8 +35,9 @@ async function runBenchmarkSuite(suite: Suite, runner: NodeBenchmarkRunner) { benchmarkSuiteGroup.push(task) } - if (benchmarkSuiteGroup.length) - await Promise.all(benchmarkSuiteGroup.map(subSuite => runBenchmarkSuite(subSuite, runner))) + // run sub suites sequentially + for (const subSuite of benchmarkSuiteGroup) + await runBenchmarkSuite(subSuite, runner) if (benchmarkGroup.length) { const defer = createDefer() diff --git a/packages/vitest/src/runtime/setup-common.ts b/packages/vitest/src/runtime/setup-common.ts index 1430366f7833..d55cf4ca4aa2 100644 --- a/packages/vitest/src/runtime/setup-common.ts +++ b/packages/vitest/src/runtime/setup-common.ts @@ -10,6 +10,7 @@ let globalSetup = false export async function setupCommonEnv(config: ResolvedConfig) { resetRunOnceCounter() setupDefines(config.defines) + setupEnv(config.env) if (globalSetup) return @@ -26,6 +27,13 @@ function setupDefines(defines: Record) { (globalThis as any)[key] = defines[key] } +function setupEnv(env: Record) { + if (typeof process === 'undefined') + return + for (const key in env) + process.env[key] = env[key] +} + export async function loadDiffConfig(config: ResolvedConfig, executor: VitestExecutor) { if (typeof config.diff !== 'string') return diff --git a/packages/vitest/src/types/coverage.ts b/packages/vitest/src/types/coverage.ts index 69425c9d7195..beddea8f79c8 100644 --- a/packages/vitest/src/types/coverage.ts +++ b/packages/vitest/src/types/coverage.ts @@ -233,7 +233,12 @@ export interface CoverageIstanbulOptions extends BaseCoverageOptions { ignoreClassMethods?: string[] } -export interface CoverageV8Options extends BaseCoverageOptions {} +export interface CoverageV8Options extends BaseCoverageOptions { + /** + * Ignore empty lines, comments and other non-runtime code, e.g. Typescript types + */ + ignoreEmptyLines?: boolean +} export interface CustomProviderOptions extends Pick { /** Name of the module or path to a file to load the custom provider from */ diff --git a/packages/vitest/src/types/matcher-utils.ts b/packages/vitest/src/types/matcher-utils.ts index c746bd307ee0..cd5f85f2fe71 100644 --- a/packages/vitest/src/types/matcher-utils.ts +++ b/packages/vitest/src/types/matcher-utils.ts @@ -31,4 +31,7 @@ export interface DiffOptions { patchColor?: Formatter // pretty-format type compareKeys?: any + truncateThreshold?: number + truncateAnnotation?: string + truncateAnnotationColor?: Formatter } diff --git a/patches/v8-to-istanbul@9.2.0.patch b/patches/v8-to-istanbul@9.2.0.patch new file mode 100644 index 000000000000..b29d2545987c --- /dev/null +++ b/patches/v8-to-istanbul@9.2.0.patch @@ -0,0 +1,156 @@ +diff --git a/CHANGELOG.md b/CHANGELOG.md +deleted file mode 100644 +index 4f7e3bc8d1bba4feb51044ff9eb77b41f972f957..0000000000000000000000000000000000000000 +diff --git a/index.d.ts b/index.d.ts +index ee7b286844f2bf96357218166e26e1c338f774cf..657531b7c75f43e9a4e957dd1f10797e44da5bb1 100644 +--- a/index.d.ts ++++ b/index.d.ts +@@ -1,5 +1,7 @@ + /// + ++// Patch applied: https://github.com/istanbuljs/v8-to-istanbul/pull/244 ++ + import { Profiler } from 'inspector' + import { CoverageMapData } from 'istanbul-lib-coverage' + import { SourceMapInput } from '@jridgewell/trace-mapping' +@@ -20,6 +22,6 @@ declare class V8ToIstanbul { + toIstanbul(): CoverageMapData + } + +-declare function v8ToIstanbul(scriptPath: string, wrapperLength?: number, sources?: Sources, excludePath?: (path: string) => boolean): V8ToIstanbul ++declare function v8ToIstanbul(scriptPath: string, wrapperLength?: number, sources?: Sources, excludePath?: (path: string) => boolean, excludeEmptyLines?: boolean): V8ToIstanbul + + export = v8ToIstanbul +diff --git a/index.js b/index.js +index 4db27a7d84324d0e6605c5506e3eee5665ddfeb0..7bfb839634b1e3c54efedc3c270d82edc4167a64 100644 +--- a/index.js ++++ b/index.js +@@ -1,5 +1,6 @@ ++// Patch applied: https://github.com/istanbuljs/v8-to-istanbul/pull/244 + const V8ToIstanbul = require('./lib/v8-to-istanbul') + +-module.exports = function (path, wrapperLength, sources, excludePath) { +- return new V8ToIstanbul(path, wrapperLength, sources, excludePath) ++module.exports = function (path, wrapperLength, sources, excludePath, excludeEmptyLines) { ++ return new V8ToIstanbul(path, wrapperLength, sources, excludePath, excludeEmptyLines) + } +diff --git a/lib/source.js b/lib/source.js +index d8ebc215f6ad83d472abafe976935acfe5c61b04..021fd2aed1f73ebb4adc449ce6e96f2d89c295a5 100644 +--- a/lib/source.js ++++ b/lib/source.js +@@ -1,23 +1,32 @@ ++// Patch applied: https://github.com/istanbuljs/v8-to-istanbul/pull/244 + const CovLine = require('./line') + const { sliceRange } = require('./range') +-const { originalPositionFor, generatedPositionFor, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND } = require('@jridgewell/trace-mapping') ++const { originalPositionFor, generatedPositionFor, eachMapping, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND } = require('@jridgewell/trace-mapping') + + module.exports = class CovSource { +- constructor (sourceRaw, wrapperLength) { ++ constructor (sourceRaw, wrapperLength, traceMap) { + sourceRaw = sourceRaw ? sourceRaw.trimEnd() : '' + this.lines = [] + this.eof = sourceRaw.length + this.shebangLength = getShebangLength(sourceRaw) + this.wrapperLength = wrapperLength - this.shebangLength +- this._buildLines(sourceRaw) ++ this._buildLines(sourceRaw, traceMap) + } + +- _buildLines (source) { ++ _buildLines (source, traceMap) { + let position = 0 + let ignoreCount = 0 + let ignoreAll = false ++ const linesToCover = traceMap && this._parseLinesToCover(traceMap) ++ + for (const [i, lineStr] of source.split(/(?<=\r?\n)/u).entries()) { +- const line = new CovLine(i + 1, position, lineStr) ++ const lineNumber = i + 1 ++ const line = new CovLine(lineNumber, position, lineStr) ++ ++ if (linesToCover && !linesToCover.has(lineNumber)) { ++ line.ignore = true ++ } ++ + if (ignoreCount > 0) { + line.ignore = true + ignoreCount-- +@@ -125,6 +134,18 @@ module.exports = class CovSource { + if (this.lines[line - 1] === undefined) return this.eof + return Math.min(this.lines[line - 1].startCol + relCol, this.lines[line - 1].endCol) + } ++ ++ _parseLinesToCover (traceMap) { ++ const linesToCover = new Set() ++ ++ eachMapping(traceMap, (mapping) => { ++ if (mapping.originalLine !== null) { ++ linesToCover.add(mapping.originalLine) ++ } ++ }) ++ ++ return linesToCover ++ } + } + + // this implementation is pulled over from istanbul-lib-sourcemap: +diff --git a/lib/v8-to-istanbul.js b/lib/v8-to-istanbul.js +index 3616437b00658861dc5a8910c64d1449e9fdf467..c1e0c0ae19984480e408713d1691fa174a7c4c1f 100644 +--- a/lib/v8-to-istanbul.js ++++ b/lib/v8-to-istanbul.js +@@ -1,3 +1,4 @@ ++// Patch applied: https://github.com/istanbuljs/v8-to-istanbul/pull/244 + const assert = require('assert') + const convertSourceMap = require('convert-source-map') + const util = require('util') +@@ -25,12 +26,13 @@ const isNode8 = /^v8\./.test(process.version) + const cjsWrapperLength = isOlderNode10 ? require('module').wrapper[0].length : 0 + + module.exports = class V8ToIstanbul { +- constructor (scriptPath, wrapperLength, sources, excludePath) { ++ constructor (scriptPath, wrapperLength, sources, excludePath, excludeEmptyLines) { + assert(typeof scriptPath === 'string', 'scriptPath must be a string') + assert(!isNode8, 'This module does not support node 8 or lower, please upgrade to node 10') + this.path = parsePath(scriptPath) + this.wrapperLength = wrapperLength === undefined ? cjsWrapperLength : wrapperLength + this.excludePath = excludePath || (() => false) ++ this.excludeEmptyLines = excludeEmptyLines === true + this.sources = sources || {} + this.generatedLines = [] + this.branches = {} +@@ -58,8 +60,8 @@ module.exports = class V8ToIstanbul { + if (!this.sourceMap.sourcesContent) { + this.sourceMap.sourcesContent = await this.sourcesContentFromSources() + } +- this.covSources = this.sourceMap.sourcesContent.map((rawSource, i) => ({ source: new CovSource(rawSource, this.wrapperLength), path: this.sourceMap.sources[i] })) +- this.sourceTranspiled = new CovSource(rawSource, this.wrapperLength) ++ this.covSources = this.sourceMap.sourcesContent.map((rawSource, i) => ({ source: new CovSource(rawSource, this.wrapperLength, this.excludeEmptyLines ? this.sourceMap : null), path: this.sourceMap.sources[i] })) ++ this.sourceTranspiled = new CovSource(rawSource, this.wrapperLength, this.excludeEmptyLines ? this.sourceMap : null) + } else { + const candidatePath = this.rawSourceMap.sourcemap.sources.length >= 1 ? this.rawSourceMap.sourcemap.sources[0] : this.rawSourceMap.sourcemap.file + this.path = this._resolveSource(this.rawSourceMap, candidatePath || this.path) +@@ -82,8 +84,8 @@ module.exports = class V8ToIstanbul { + // We fallback to reading the original source from disk. + originalRawSource = await readFile(this.path, 'utf8') + } +- this.covSources = [{ source: new CovSource(originalRawSource, this.wrapperLength), path: this.path }] +- this.sourceTranspiled = new CovSource(rawSource, this.wrapperLength) ++ this.covSources = [{ source: new CovSource(originalRawSource, this.wrapperLength, this.excludeEmptyLines ? this.sourceMap : null), path: this.path }] ++ this.sourceTranspiled = new CovSource(rawSource, this.wrapperLength, this.excludeEmptyLines ? this.sourceMap : null) + } + } else { + this.covSources = [{ source: new CovSource(rawSource, this.wrapperLength), path: this.path }] +@@ -281,8 +283,10 @@ module.exports = class V8ToIstanbul { + s: {} + } + source.lines.forEach((line, index) => { +- statements.statementMap[`${index}`] = line.toIstanbul() +- statements.s[`${index}`] = line.ignore ? 1 : line.count ++ if (!line.ignore) { ++ statements.statementMap[`${index}`] = line.toIstanbul() ++ statements.s[`${index}`] = line.count ++ } + }) + return statements + } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca743eb91977..ba0cbda47ed3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: overrides: rollup: ^4.9.6 - vite: ^5.0.12 + vite: ^5.2.6 vitest: workspace:* patchedDependencies: @@ -22,6 +22,9 @@ patchedDependencies: cac@6.7.14: hash: slh3cigivjjjktoa42g2agwaem path: patches/cac@6.7.14.patch + v8-to-istanbul@9.2.0: + hash: zm2cjmgndzbmnuve7zu5emyu7i + path: patches/v8-to-istanbul@9.2.0.patch importers: @@ -109,8 +112,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:packages/vitest @@ -147,7 +150,7 @@ importers: version: 0.2.3(vite-plugin-pwa@0.16.7) '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) fast-glob: specifier: ^3.3.2 version: 3.3.2 @@ -156,16 +159,16 @@ importers: version: 4.7.1 unocss: specifier: ^0.57.4 - version: 0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.0.12) + version: 0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.2.6) unplugin-vue-components: specifier: ^0.25.2 version: 0.25.2(rollup@4.9.6)(vue@3.3.8) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-plugin-pwa: specifier: ^0.16.7 - version: 0.16.7(vite@5.0.12)(workbox-build@7.0.0)(workbox-window@7.0.0) + version: 0.16.7(vite@5.2.6)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0 version: 1.0.0(@types/node@20.11.5)(postcss@8.4.38)(search-insights@2.9.0)(typescript@5.2.2) @@ -179,8 +182,8 @@ importers: specifier: latest version: link:../../packages/ui vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -203,8 +206,8 @@ importers: specifier: ^3.9.0 version: 3.9.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -222,8 +225,8 @@ importers: specifier: latest version: link:../../packages/ui vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -237,8 +240,8 @@ importers: specifier: ^4.5.1 version: 4.5.1(jest@27.5.1) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -259,8 +262,8 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -278,7 +281,7 @@ importers: version: 6.1.4(marko@5.32.0) '@marko/vite': specifier: latest - version: 4.1.0(@marko/compiler@5.34.1)(vite@5.0.12) + version: 4.1.0(@marko/compiler@5.34.1)(vite@5.2.6) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -289,8 +292,8 @@ importers: specifier: latest version: 5.32.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -317,8 +320,8 @@ importers: specifier: ^11.6.16 version: 11.6.16 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -370,7 +373,7 @@ importers: version: 18.2.38 '@vitejs/plugin-react': specifier: latest - version: 4.2.0(vite@5.0.12) + version: 4.2.0(vite@5.2.6) jsdom: specifier: latest version: 22.1.0 @@ -393,8 +396,8 @@ importers: specifier: ^1.41.0 version: 1.41.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -416,7 +419,7 @@ importers: devDependencies: '@preact/preset-vite': specifier: ^2.6.0 - version: 2.6.0(@babel/core@7.23.3)(preact@10.15.1)(vite@5.0.12) + version: 2.6.0(@babel/core@7.23.3)(preact@10.15.1)(vite@5.2.6) '@testing-library/jest-dom': specifier: ^5.16.4 version: 5.16.5 @@ -433,8 +436,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -453,7 +456,7 @@ importers: version: 17.0.2 '@vitejs/plugin-react': specifier: latest - version: 4.2.0(vite@5.0.12) + version: 4.2.0(vite@5.2.6) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -467,8 +470,8 @@ importers: specifier: 17.0.2 version: 17.0.2(react@17.0.2) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -531,8 +534,8 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -569,7 +572,7 @@ importers: version: 6.5.10(react-dom@17.0.2)(react@17.0.2) '@storybook/builder-vite': specifier: ^0.1.35 - version: 0.1.41(@babel/core@7.23.3)(@storybook/core-common@7.5.1)(@storybook/node-logger@7.5.1)(@storybook/source-loader@7.5.1)(react@17.0.2)(typescript@5.2.2)(vite@5.0.12) + version: 0.1.41(@babel/core@7.23.3)(@storybook/core-common@7.5.1)(@storybook/node-logger@7.5.1)(@storybook/source-loader@7.5.1)(react@17.0.2)(typescript@5.2.2)(vite@5.2.6) '@storybook/client-api': specifier: ^6.5.5 version: 6.5.10(react-dom@17.0.2)(react@17.0.2) @@ -599,7 +602,7 @@ importers: version: 17.0.17 '@vitejs/plugin-react': specifier: ^4.1.0 - version: 4.1.1(vite@5.0.12) + version: 4.1.1(vite@5.2.6) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -619,8 +622,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -651,7 +654,7 @@ importers: version: 18.0.8 '@vitejs/plugin-react': specifier: latest - version: 4.2.0(vite@5.0.12) + version: 4.2.0(vite@5.2.6) '@vitest/coverage-v8': specifier: latest version: link:../../packages/coverage-v8 @@ -665,8 +668,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -697,7 +700,7 @@ importers: version: 18.2.14 '@vitejs/plugin-react': specifier: latest - version: 4.2.0(vite@5.0.12) + version: 4.2.0(vite@5.2.6) '@vitest/ui': specifier: latest version: link:../../packages/ui @@ -708,8 +711,8 @@ importers: specifier: ^2.0.0 version: 2.0.0(typescript@5.2.2) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -718,7 +721,7 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) '@vue/test-utils': specifier: latest version: 2.4.1(vue@3.3.8) @@ -726,11 +729,11 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-plugin-ruby: specifier: ^3.2.2 - version: 3.2.2(vite@5.0.12) + version: 3.2.2(vite@5.2.6) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -754,11 +757,11 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-plugin-solid: specifier: ^2.7.2 - version: 2.7.2(solid-js@1.8.3)(vite@5.0.12) + version: 2.7.2(solid-js@1.8.3)(vite@5.2.6) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -767,7 +770,7 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': specifier: latest - version: 3.0.1(svelte@4.1.1)(vite@5.0.12) + version: 3.0.1(svelte@4.1.1)(vite@5.2.6) '@testing-library/svelte': specifier: ^4.0.3 version: 4.0.3(svelte@4.1.1) @@ -781,8 +784,8 @@ importers: specifier: latest version: 4.1.1 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -794,7 +797,7 @@ importers: version: 2.1.0(@sveltejs/kit@1.20.2) '@sveltejs/kit': specifier: ^1.20.2 - version: 1.20.2(svelte@3.59.1)(vite@5.0.12) + version: 1.20.2(svelte@3.59.1)(vite@5.2.6) prettier: specifier: ^2.8.8 version: 2.8.8 @@ -814,8 +817,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -832,8 +835,8 @@ importers: specifier: ^5.2.2 version: 5.2.2 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -846,7 +849,7 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) '@vue/test-utils': specifier: ^2.0.2 version: 2.0.2(vue@3.3.8) @@ -860,8 +863,8 @@ importers: specifier: latest version: 0.25.2(rollup@4.9.6)(vue@3.3.8) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -874,7 +877,7 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) '@vue/test-utils': specifier: ^2.4.1 version: 2.4.1(vue@3.3.8) @@ -882,8 +885,8 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -892,10 +895,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) '@vitejs/plugin-vue-jsx': specifier: latest - version: 3.1.0(vite@5.0.12)(vue@3.3.8) + version: 3.1.0(vite@5.2.6)(vue@3.3.8) '@vue/test-utils': specifier: latest version: 2.4.1(vue@3.3.8) @@ -903,8 +906,8 @@ importers: specifier: latest version: 22.1.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -918,8 +921,8 @@ importers: specifier: latest version: link:../../packages/ui vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1066,9 +1069,6 @@ importers: test-exclude: specifier: ^6.0.0 version: 6.0.0 - v8-to-istanbul: - specifier: ^9.2.0 - version: 9.2.0 devDependencies: '@types/debug': specifier: ^4.1.12 @@ -1088,6 +1088,9 @@ importers: pathe: specifier: ^1.1.1 version: 1.1.1 + v8-to-istanbul: + specifier: ^9.2.0 + version: 9.2.0(patch_hash=zm2cjmgndzbmnuve7zu5emyu7i) vite-node: specifier: workspace:* version: link:../vite-node @@ -1213,10 +1216,10 @@ importers: version: 0.57.4 '@vitejs/plugin-vue': specifier: ^5.0.3 - version: 5.0.3(vite@5.0.12)(vue@3.3.8) + version: 5.0.3(vite@5.2.6)(vue@3.3.8) '@vitejs/plugin-vue-jsx': specifier: ^3.0.2 - version: 3.0.2(vite@5.0.12)(vue@3.3.8) + version: 3.0.2(vite@5.2.6)(vue@3.3.8) '@vitest/runner': specifier: workspace:* version: link:../runner @@ -1252,7 +1255,7 @@ importers: version: 3.1.5 unocss: specifier: ^0.57.4 - version: 0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.0.12) + version: 0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.2.6) unplugin-auto-import: specifier: ^0.16.7 version: 0.16.7(@vueuse/core@10.6.1)(rollup@4.9.6) @@ -1260,11 +1263,11 @@ importers: specifier: ^0.25.2 version: 0.25.2(rollup@4.9.6)(vue@3.3.8) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-plugin-pages: specifier: ^0.31.0 - version: 0.31.0(@vue/compiler-sfc@3.4.21)(vite@5.0.12) + version: 0.31.0(@vue/compiler-sfc@3.4.21)(vite@5.0.16) vue: specifier: ^3.3.8 version: 3.3.8(typescript@5.2.2) @@ -1312,8 +1315,8 @@ importers: specifier: ^1.0.0 version: 1.0.0 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) devDependencies: '@jridgewell/trace-mapping': specifier: ^0.3.22 @@ -1382,8 +1385,8 @@ importers: specifier: ^0.8.3 version: 0.8.3 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-node: specifier: workspace:* version: link:../vite-node @@ -1523,8 +1526,8 @@ importers: specifier: workspace:* version: link:../../packages/browser vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1548,7 +1551,7 @@ importers: devDependencies: '@vitejs/plugin-basic-ssl': specifier: ^1.0.2 - version: 1.0.2(vite@5.0.12) + version: 1.0.2(vite@5.2.6) '@vitest/browser': specifier: workspace:* version: link:../../packages/browser @@ -1619,8 +1622,8 @@ importers: test/cli: devDependencies: vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1631,8 +1634,8 @@ importers: specifier: ^8.0.1 version: 8.0.1 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1680,7 +1683,7 @@ importers: version: 3.0.3 '@vitejs/plugin-vue': specifier: latest - version: 4.5.0(vite@5.0.12)(vue@3.3.8) + version: 4.5.0(vite@5.2.6)(vue@3.3.8) '@vitest/browser': specifier: workspace:* version: link:../../packages/browser @@ -1709,8 +1712,8 @@ importers: specifier: ^1.4.4 version: 1.4.4(@swc/core@1.4.1)(rollup@4.9.6) vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1793,8 +1796,8 @@ importers: specifier: latest version: 12.10.3 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1836,8 +1839,8 @@ importers: test/filters: devDependencies: vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1863,8 +1866,8 @@ importers: test/inspect: devDependencies: vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -1964,8 +1967,8 @@ importers: specifier: ^7.1.1 version: 7.1.1 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -2015,8 +2018,8 @@ importers: specifier: ^7.0.1 version: 7.0.1 vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vite-node: specifier: workspace:* version: link:../../packages/vite-node @@ -2115,8 +2118,8 @@ importers: specifier: workspace:* version: link:../../packages/browser vite: - specifier: ^5.0.12 - version: 5.0.12(@types/node@20.11.5)(less@4.1.3) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.5)(less@4.1.3) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -2164,7 +2167,7 @@ importers: devDependencies: '@vitejs/plugin-basic-ssl': specifier: ^1.0.2 - version: 1.0.2(vite@5.0.12) + version: 1.0.2(vite@5.2.6) vitest: specifier: workspace:* version: link:../../packages/vitest @@ -5238,6 +5241,15 @@ packages: cpu: [ppc64] os: [aix] requiresBuild: true + dev: true + optional: true + + /@esbuild/aix-ppc64@0.20.2: + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true optional: true /@esbuild/android-arm64@0.18.20: @@ -5255,6 +5267,15 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.20.2: + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true optional: true /@esbuild/android-arm@0.15.18: @@ -5281,6 +5302,15 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.20.2: + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true optional: true /@esbuild/android-x64@0.18.20: @@ -5298,6 +5328,15 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.20.2: + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true optional: true /@esbuild/darwin-arm64@0.18.20: @@ -5315,6 +5354,15 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.20.2: + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true optional: true /@esbuild/darwin-x64@0.18.20: @@ -5332,6 +5380,15 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.20.2: + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true optional: true /@esbuild/freebsd-arm64@0.18.20: @@ -5349,6 +5406,15 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.20.2: + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true optional: true /@esbuild/freebsd-x64@0.18.20: @@ -5366,6 +5432,15 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.20.2: + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true optional: true /@esbuild/linux-arm64@0.18.20: @@ -5383,6 +5458,15 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.20.2: + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-arm@0.18.20: @@ -5400,6 +5484,15 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.20.2: + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-ia32@0.18.20: @@ -5417,6 +5510,15 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.20.2: + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-loong64@0.15.18: @@ -5443,6 +5545,15 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.20.2: + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-mips64el@0.18.20: @@ -5460,6 +5571,15 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.20.2: + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-ppc64@0.18.20: @@ -5477,6 +5597,15 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.20.2: + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-riscv64@0.18.20: @@ -5494,6 +5623,15 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.20.2: + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-s390x@0.18.20: @@ -5511,6 +5649,15 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.20.2: + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true optional: true /@esbuild/linux-x64@0.18.20: @@ -5528,6 +5675,15 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.20.2: + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true optional: true /@esbuild/netbsd-x64@0.18.20: @@ -5545,6 +5701,15 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.20.2: + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true optional: true /@esbuild/openbsd-x64@0.18.20: @@ -5562,6 +5727,15 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.20.2: + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true optional: true /@esbuild/sunos-x64@0.18.20: @@ -5579,6 +5753,15 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.20.2: + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true optional: true /@esbuild/win32-arm64@0.18.20: @@ -5596,6 +5779,15 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.20.2: + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true optional: true /@esbuild/win32-ia32@0.18.20: @@ -5613,6 +5805,15 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.20.2: + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true optional: true /@esbuild/win32-x64@0.18.20: @@ -5630,6 +5831,15 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.20.2: + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.54.0): @@ -6118,18 +6328,18 @@ packages: chalk: 4.1.2 dev: true - /@joshwooding/vite-plugin-react-docgen-typescript@0.0.4(typescript@5.2.2)(vite@5.0.12): + /@joshwooding/vite-plugin-react-docgen-typescript@0.0.4(typescript@5.2.2)(vite@5.2.6): resolution: {integrity: sha512-ezL7SU//1OV4Oyt/zQ3CsX8uLujVEYUHuULkqgcW6wOuQfRnvgkn99HZtLWwS257GmZVwszGQzhL7VE3PbMAYw==} peerDependencies: typescript: '>= 4.3.x' - vite: ^5.0.12 + vite: ^5.2.6 dependencies: glob: 7.2.3 glob-promise: 4.2.2(glob@7.2.3) magic-string: 0.26.7 react-docgen-typescript: 2.2.2(typescript@5.2.2) typescript: 5.2.2 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) dev: true /@jridgewell/gen-mapping@0.3.2: @@ -6191,6 +6401,7 @@ packages: dependencies: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + dev: true /@jridgewell/trace-mapping@0.3.22: resolution: {integrity: sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==} @@ -6298,11 +6509,11 @@ packages: self-closing-tags: 1.0.1 dev: true - /@marko/vite@4.1.0(@marko/compiler@5.34.1)(vite@5.0.12): + /@marko/vite@4.1.0(@marko/compiler@5.34.1)(vite@5.2.6): resolution: {integrity: sha512-3cixhQvMOzeWx1YvpW9N4KzwccEHmrFPhfuGDQFi53BBh0ccgBRmb2/Aly7oCDFEP8qwZZkuDJX3278nB7KmdQ==} peerDependencies: '@marko/compiler': ^5 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@marko/compiler': 5.34.1 anymatch: 3.1.3 @@ -6311,7 +6522,7 @@ packages: htmlparser2: 9.0.0 resolve: 1.22.8 resolve.exports: 2.0.2 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) dev: true /@mdx-js/mdx@1.6.22: @@ -7033,22 +7244,22 @@ packages: preact: 10.15.1 dev: false - /@preact/preset-vite@2.6.0(@babel/core@7.23.3)(preact@10.15.1)(vite@5.0.12): + /@preact/preset-vite@2.6.0(@babel/core@7.23.3)(preact@10.15.1)(vite@5.2.6): resolution: {integrity: sha512-5nztNzXbCpqyVum/K94nB2YQ5PTnvWdz4u7/X0jc8+kLyskSSpkNUxLQJeI90zfGSFIX1Ibj2G2JIS/mySHWYQ==} peerDependencies: '@babel/core': 7.x - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@babel/core': 7.23.3 '@babel/plugin-transform-react-jsx': 7.22.15(@babel/core@7.23.3) '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.23.3) - '@prefresh/vite': 2.4.1(preact@10.15.1)(vite@5.0.12) + '@prefresh/vite': 2.4.1(preact@10.15.1)(vite@5.2.6) '@rollup/pluginutils': 4.2.1 babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.23.3) debug: 4.3.4(supports-color@8.1.1) kolorist: 1.8.0 resolve: 1.22.8 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - preact - supports-color @@ -7070,11 +7281,11 @@ packages: resolution: {integrity: sha512-KtC/fZw+oqtwOLUFM9UtiitB0JsVX0zLKNyRTA332sqREqSALIIQQxdUCS1P3xR/jT1e2e8/5rwH6gdcMLEmsQ==} dev: true - /@prefresh/vite@2.4.1(preact@10.15.1)(vite@5.0.12): + /@prefresh/vite@2.4.1(preact@10.15.1)(vite@5.2.6): resolution: {integrity: sha512-vthWmEqu8TZFeyrBNc9YE5SiC3DVSzPgsOCp/WQ7FqdHpOIJi7Z8XvCK06rBPOtG4914S52MjG9Ls22eVAiuqQ==} peerDependencies: preact: ^10.4.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@babel/core': 7.23.3 '@prefresh/babel-plugin': 0.5.0 @@ -7082,7 +7293,7 @@ packages: '@prefresh/utils': 1.2.0 '@rollup/pluginutils': 4.2.1 preact: 10.15.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true @@ -7875,19 +8086,19 @@ packages: util-deprecate: 1.0.2 dev: true - /@storybook/builder-vite@0.1.41(@babel/core@7.23.3)(@storybook/core-common@7.5.1)(@storybook/node-logger@7.5.1)(@storybook/source-loader@7.5.1)(react@17.0.2)(typescript@5.2.2)(vite@5.0.12): + /@storybook/builder-vite@0.1.41(@babel/core@7.23.3)(@storybook/core-common@7.5.1)(@storybook/node-logger@7.5.1)(@storybook/source-loader@7.5.1)(react@17.0.2)(typescript@5.2.2)(vite@5.2.6): resolution: {integrity: sha512-h/7AgEUfSuVexTD6LuJ6BCNu+FSo/+IKYBQ1O3TyF2BEgcob5/BGrx9QcwM0LJCF44L1zNKaxkKpCZs9p+LRRA==} peerDependencies: '@storybook/core-common': '>=6.4.3 || >=6.5.0-alpha.0' '@storybook/mdx2-csf': ^0.0.3 '@storybook/node-logger': '>=6.4.3 || >=6.5.0-alpha.0' '@storybook/source-loader': '>=6.4.3 || >=6.5.0-alpha.0' - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: '@storybook/mdx2-csf': optional: true dependencies: - '@joshwooding/vite-plugin-react-docgen-typescript': 0.0.4(typescript@5.2.2)(vite@5.0.12) + '@joshwooding/vite-plugin-react-docgen-typescript': 0.0.4(typescript@5.2.2)(vite@5.2.6) '@storybook/core-common': 7.5.1 '@storybook/mdx1-csf': 0.0.4(@babel/core@7.23.3)(react@17.0.2) '@storybook/node-logger': 7.5.1 @@ -7901,7 +8112,7 @@ packages: react-docgen: 6.0.0-alpha.3 slash: 3.0.0 sveltedoc-parser: 4.2.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - '@babel/core' - react @@ -8981,20 +9192,20 @@ packages: peerDependencies: '@sveltejs/kit': ^1.0.0 dependencies: - '@sveltejs/kit': 1.20.2(svelte@3.59.1)(vite@5.0.12) + '@sveltejs/kit': 1.20.2(svelte@3.59.1)(vite@5.2.6) import-meta-resolve: 3.0.0 dev: true - /@sveltejs/kit@1.20.2(svelte@3.59.1)(vite@5.0.12): + /@sveltejs/kit@1.20.2(svelte@3.59.1)(vite@5.2.6): resolution: {integrity: sha512-MtR1i+HtmYWcRgtubw1GQqT/+CWXL/z24PegE0xYAdObbhdr7YtEfmoe705D/JZMtMmoPXrmSk4W0MfL5A3lYw==} engines: {node: ^16.14 || >=18} hasBin: true requiresBuild: true peerDependencies: svelte: ^3.54.0 || ^4.0.0-next.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@3.59.1)(vite@5.0.12) + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@3.59.1)(vite@5.2.6) '@types/cookie': 0.5.1 cookie: 0.5.0 devalue: 4.3.2 @@ -9008,79 +9219,79 @@ packages: svelte: 3.59.1 tiny-glob: 0.2.9 undici: 5.22.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true - /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@3.59.1)(vite@5.0.12): + /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@3.59.1)(vite@5.2.6): resolution: {integrity: sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: '@sveltejs/vite-plugin-svelte': ^2.2.0 svelte: ^3.54.0 || ^4.0.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@3.59.1)(vite@5.0.12) + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@3.59.1)(vite@5.2.6) debug: 4.3.4(supports-color@8.1.1) svelte: 3.59.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true - /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.1.1)(vite@5.0.12): + /@sveltejs/vite-plugin-svelte-inspector@2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.1.1)(vite@5.2.6): resolution: {integrity: sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==} engines: {node: ^18.0.0 || >=20} peerDependencies: '@sveltejs/vite-plugin-svelte': ^3.0.0 svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.1.1)(vite@5.0.12) + '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.1.1)(vite@5.2.6) debug: 4.3.4(supports-color@8.1.1) svelte: 4.1.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true - /@sveltejs/vite-plugin-svelte@2.4.6(svelte@3.59.1)(vite@5.0.12): + /@sveltejs/vite-plugin-svelte@2.4.6(svelte@3.59.1)(vite@5.2.6): resolution: {integrity: sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==} engines: {node: ^14.18.0 || >= 16} peerDependencies: svelte: ^3.54.0 || ^4.0.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@3.59.1)(vite@5.0.12) + '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@3.59.1)(vite@5.2.6) debug: 4.3.4(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.5 svelte: 3.59.1 svelte-hmr: 0.15.3(svelte@3.59.1) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) - vitefu: 0.2.4(vite@5.0.12) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) + vitefu: 0.2.4(vite@5.2.6) transitivePeerDependencies: - supports-color dev: true - /@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.1.1)(vite@5.0.12): + /@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.1.1)(vite@5.2.6): resolution: {integrity: sha512-CGURX6Ps+TkOovK6xV+Y2rn8JKa8ZPUHPZ/NKgCxAmgBrXReavzFl8aOSCj3kQ1xqT7yGJj53hjcV/gqwDAaWA==} engines: {node: ^18.0.0 || >=20} peerDependencies: svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.1.1)(vite@5.0.12) + '@sveltejs/vite-plugin-svelte-inspector': 2.0.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.1.1)(vite@5.2.6) debug: 4.3.4(supports-color@8.1.1) deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.5 svelte: 4.1.1 svelte-hmr: 0.15.3(svelte@4.1.1) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) - vitefu: 0.2.5(vite@5.0.12) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) + vitefu: 0.2.5(vite@5.2.6) transitivePeerDependencies: - supports-color dev: true @@ -9674,6 +9885,7 @@ packages: /@types/istanbul-lib-coverage@2.0.6: resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + dev: true /@types/istanbul-lib-instrument@1.7.7: resolution: {integrity: sha512-xyV3cVIhVuVAT7wyJXT+lliOo4b7BpfsnfCDy0/nuuAX+J7RB2rWNDV/7hkmv62vwqAD2XQ2Fgt6OwWGWEYfvg==} @@ -10331,18 +10543,18 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@unocss/astro@0.57.4(rollup@4.9.6)(vite@5.0.12): + /@unocss/astro@0.57.4(rollup@4.9.6)(vite@5.2.6): resolution: {integrity: sha512-BP7+X/AlUFFMzr5s8bUpbO4HsWBESzIcPUE9VMA4bpSJIbXxi9GyJRU3Av72nbQp4BBeDjYiDT0qRa5gS0oPxw==} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: vite: optional: true dependencies: '@unocss/core': 0.57.4 '@unocss/reset': 0.57.4 - '@unocss/vite': 0.57.4(rollup@4.9.6)(vite@5.0.12) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + '@unocss/vite': 0.57.4(rollup@4.9.6)(vite@5.2.6) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - rollup dev: true @@ -10520,10 +10732,10 @@ packages: '@unocss/core': 0.57.4 dev: true - /@unocss/vite@0.57.4(rollup@4.9.6)(vite@5.0.12): + /@unocss/vite@0.57.4(rollup@4.9.6)(vite@5.2.6): resolution: {integrity: sha512-bVMftC1hzdlfRQOfllDuJ+bd5Z0/TOvPthNk8LyoHsnjAEH7FqspdCyPM3nQpnfqfYRocXiuLJv+KdQ2DLQWOQ==} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@ampproject/remapping': 2.2.1 '@rollup/pluginutils': 5.0.5(rollup@4.9.6) @@ -10535,7 +10747,7 @@ packages: chokidar: 3.5.3 fast-glob: 3.3.2 magic-string: 0.30.5 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - rollup dev: true @@ -10558,16 +10770,16 @@ packages: peerDependencies: vite-plugin-pwa: '>=0.16.5 <1' dependencies: - vite-plugin-pwa: 0.16.7(vite@5.0.12)(workbox-build@7.0.0)(workbox-window@7.0.0) + vite-plugin-pwa: 0.16.7(vite@5.2.6)(workbox-build@7.0.0)(workbox-window@7.0.0) dev: true - /@vitejs/plugin-basic-ssl@1.0.2(vite@5.0.12): + /@vitejs/plugin-basic-ssl@1.0.2(vite@5.2.6): resolution: {integrity: sha512-DKHKVtpI+eA5fvObVgQ3QtTGU70CcCnedalzqmGSR050AzKZMdUzgC8KmlOneHWH8dF2hJ3wkC9+8FDVAaDRCw==} engines: {node: '>=14.6.0'} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 dependencies: - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) dev: true /@vitejs/plugin-react@1.3.2: @@ -10586,89 +10798,100 @@ packages: - supports-color dev: true - /@vitejs/plugin-react@4.1.1(vite@5.0.12): + /@vitejs/plugin-react@4.1.1(vite@5.2.6): resolution: {integrity: sha512-Jie2HERK+uh27e+ORXXwEP5h0Y2lS9T2PRGbfebiHGlwzDO0dEnd2aNtOR/qjBlPb1YgxwAONeblL1xqLikLag==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@babel/core': 7.23.3 '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.23.3) '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.23.3) '@types/babel__core': 7.20.3 react-refresh: 0.14.0 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-react@4.2.0(vite@5.0.12): + /@vitejs/plugin-react@4.2.0(vite@5.2.6): resolution: {integrity: sha512-+MHTH/e6H12kRp5HUkzOGqPMksezRMmW+TNzlh/QXfI8rRf6l2Z2yH/v12no1UvTwhZgEDMuQ7g7rrfMseU6FQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@babel/core': 7.23.3 '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.3) '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.3) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.0.12(@types/node@20.9.5) + vite: 5.2.6(@types/node@20.9.5) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue-jsx@3.0.2(vite@5.0.12)(vue@3.3.8): + /@vitejs/plugin-vue-jsx@3.0.2(vite@5.2.6)(vue@3.3.8): resolution: {integrity: sha512-obF26P2Z4Ogy3cPp07B4VaW6rpiu0ue4OT2Y15UxT5BZZ76haUY9guOsZV3uWh/I6xc+VeiW+ZVabRE82FyzWw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 vue: ^3.0.0 dependencies: '@babel/core': 7.23.3 '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.3) '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.3) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) vue: 3.3.8(typescript@5.2.2) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue-jsx@3.1.0(vite@5.0.12)(vue@3.3.8): + /@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.6)(vue@3.3.8): resolution: {integrity: sha512-w9M6F3LSEU5kszVb9An2/MmXNxocAnUb3WhRr8bHlimhDrXNt6n6D2nJQR3UXpGlZHh/EsgouOHCsM8V3Ln+WA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 vue: ^3.0.0 dependencies: '@babel/core': 7.23.3 '@babel/plugin-transform-typescript': 7.23.4(@babel/core@7.23.3) '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.3) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) vue: 3.3.8(typescript@5.2.2) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue@4.5.0(vite@5.0.12)(vue@3.3.8): + /@vitejs/plugin-vue@4.5.0(vite@5.2.6)(vue@3.3.8): resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 vue: ^3.2.25 dependencies: - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) vue: 3.3.8(typescript@5.2.2) dev: true - /@vitejs/plugin-vue@5.0.3(vite@5.0.12)(vue@3.3.8): + /@vitejs/plugin-vue@5.0.2(vite@5.2.6)(vue@3.4.5): + resolution: {integrity: sha512-kEjJHrLb5ePBvjD0SPZwJlw1QTRcjjCA9sB5VyfonoXVBxTS7TMnqL6EkLt1Eu61RDeiuZ/WN9Hf6PxXhPI2uA==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.2.6 + vue: ^3.2.25 + dependencies: + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) + vue: 3.4.5(typescript@5.2.2) + dev: true + + /@vitejs/plugin-vue@5.0.3(vite@5.2.6)(vue@3.3.8): resolution: {integrity: sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 vue: ^3.2.25 dependencies: - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) vue: 3.3.8(typescript@5.2.2) dev: true @@ -13121,7 +13344,7 @@ packages: istanbul-reports: 3.1.6 rimraf: 3.0.2 test-exclude: 6.0.0 - v8-to-istanbul: 9.2.0 + v8-to-istanbul: 9.2.0(patch_hash=zm2cjmgndzbmnuve7zu5emyu7i) yargs: 16.2.0 yargs-parser: 20.2.9 dev: true @@ -15704,6 +15927,37 @@ packages: '@esbuild/win32-arm64': 0.19.11 '@esbuild/win32-ia32': 0.19.11 '@esbuild/win32-x64': 0.19.11 + dev: true + + /esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -22949,6 +23203,24 @@ packages: nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true + + /postcss@8.4.35: + resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + + /postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.2.0 /postcss@8.4.38: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} @@ -26804,19 +27076,19 @@ packages: detect-node: 2.1.0 dev: false - /unocss@0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.0.12): + /unocss@0.57.4(postcss@8.4.38)(rollup@4.9.6)(vite@5.2.6): resolution: {integrity: sha512-rf5eiCVb8957rqzCyRxLzljeYguVMS70X322/Z1sYhosKhh8SBBMsC/TrZEf5o8LTn/MbFN9fVizEtbUKaFjUg==} engines: {node: '>=14'} peerDependencies: '@unocss/webpack': 0.57.4 - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: '@unocss/webpack': optional: true vite: optional: true dependencies: - '@unocss/astro': 0.57.4(rollup@4.9.6)(vite@5.0.12) + '@unocss/astro': 0.57.4(rollup@4.9.6)(vite@5.2.6) '@unocss/cli': 0.57.4(rollup@4.9.6) '@unocss/core': 0.57.4 '@unocss/extractor-arbitrary-variants': 0.57.4 @@ -26835,8 +27107,8 @@ packages: '@unocss/transformer-compile-class': 0.57.4 '@unocss/transformer-directives': 0.57.4 '@unocss/transformer-variant-group': 0.57.4 - '@unocss/vite': 0.57.4(rollup@4.9.6)(vite@5.0.12) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + '@unocss/vite': 0.57.4(rollup@4.9.6)(vite@5.2.6) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - postcss - rollup @@ -27164,13 +27436,15 @@ packages: source-map: 0.7.4 dev: true - /v8-to-istanbul@9.2.0: + /v8-to-istanbul@9.2.0(patch_hash=zm2cjmgndzbmnuve7zu5emyu7i): resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: '@jridgewell/trace-mapping': 0.3.20 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 + dev: true + patched: true /validate-html-nesting@1.2.2: resolution: {integrity: sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==} @@ -27228,19 +27502,11 @@ packages: vfile-message: 2.0.4 dev: true - /vfile@6.0.1: - resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==} - dependencies: - '@types/unist': 3.0.2 - unist-util-stringify-position: 4.0.0 - vfile-message: 4.0.2 - dev: true - - /vite-plugin-pages@0.31.0(@vue/compiler-sfc@3.4.21)(vite@5.0.12): + /vite-plugin-pages@0.31.0(@vue/compiler-sfc@3.4.21)(vite@5.2.6): resolution: {integrity: sha512-fw3onBfVTXQI7rOzAbSZhmfwvk50+3qNnGZpERjmD93c8nEjrGLyd53eFXYMxcJV4KA1vzi4qIHt2+6tS4dEMw==} peerDependencies: '@vue/compiler-sfc': ^2.7.0 || ^3.0.0 - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: '@vue/compiler-sfc': optional: true @@ -27254,47 +27520,47 @@ packages: json5: 2.2.3 local-pkg: 0.4.3 picocolors: 1.0.0 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) yaml: 2.3.1 transitivePeerDependencies: - supports-color dev: true - /vite-plugin-pwa@0.16.7(vite@5.0.12)(workbox-build@7.0.0)(workbox-window@7.0.0): + /vite-plugin-pwa@0.16.7(vite@5.2.6)(workbox-build@7.0.0)(workbox-window@7.0.0): resolution: {integrity: sha512-4WMA5unuKlHs+koNoykeuCfTcqEGbiTRr8sVYUQMhc6tWxZpSRnv9Ojk4LKmqVhoPGHfBVCdGaMo8t9Qidkc1Q==} engines: {node: '>=16.0.0'} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 workbox-build: ^7.0.0 workbox-window: ^7.0.0 dependencies: debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.3.2 pretty-bytes: 6.1.1 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true - /vite-plugin-ruby@3.2.2(vite@5.0.12): + /vite-plugin-ruby@3.2.2(vite@5.2.6): resolution: {integrity: sha512-cuHG1MajRWPR8YdfF6lvgsQRnKFEBRwZF//asFbRiI1psacxB5aPlHSvYZYxAu5IflrAa0MdR0HxEq+g98M3iQ==} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 dependencies: debug: 4.3.4(supports-color@8.1.1) fast-glob: 3.3.2 - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) transitivePeerDependencies: - supports-color dev: true - /vite-plugin-solid@2.7.2(solid-js@1.8.3)(vite@5.0.12): + /vite-plugin-solid@2.7.2(solid-js@1.8.3)(vite@5.2.6): resolution: {integrity: sha512-GV2SMLAibOoXe76i02AsjAg7sbm/0lngBlERvJKVN67HOrJsHcWgkt0R6sfGLDJuFkv2aBe14Zm4vJcNME+7zw==} peerDependencies: solid-js: ^1.7.2 - vite: ^5.0.12 + vite: ^5.2.6 dependencies: '@babel/core': 7.23.3 '@babel/preset-typescript': 7.23.2(@babel/core@7.23.3) @@ -27303,14 +27569,14 @@ packages: merge-anything: 5.1.7 solid-js: 1.8.3 solid-refresh: 0.5.3(solid-js@1.8.3) - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) - vitefu: 0.2.4(vite@5.0.12) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) + vitefu: 0.2.4(vite@5.2.6) transitivePeerDependencies: - supports-color dev: true - /vite@5.0.12(@types/node@20.11.5): - resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} + /vite@5.2.6(@types/node@20.11.5)(less@4.1.3): + resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -27338,51 +27604,15 @@ packages: optional: true dependencies: '@types/node': 20.11.5 - esbuild: 0.19.11 - postcss: 8.4.32 - rollup: 4.9.6 - optionalDependencies: - fsevents: 2.3.3 - dev: true - - /vite@5.0.12(@types/node@20.11.5)(less@4.1.3): - resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 20.11.5 - esbuild: 0.19.11 + esbuild: 0.20.2 less: 4.1.3 - postcss: 8.4.32 + postcss: 8.4.38 rollup: 4.9.6 optionalDependencies: fsevents: 2.3.3 - /vite@5.0.12(@types/node@20.9.5): - resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} + /vite@5.2.6(@types/node@20.9.5): + resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -27410,33 +27640,33 @@ packages: optional: true dependencies: '@types/node': 20.9.5 - esbuild: 0.19.11 - postcss: 8.4.32 + esbuild: 0.20.2 + postcss: 8.4.38 rollup: 4.9.6 optionalDependencies: fsevents: 2.3.3 dev: true - /vitefu@0.2.4(vite@5.0.12): + /vitefu@0.2.4(vite@5.2.6): resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: vite: optional: true dependencies: - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) dev: true - /vitefu@0.2.5(vite@5.0.12): + /vitefu@0.2.5(vite@5.2.6): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: - vite: ^5.0.12 + vite: ^5.2.6 peerDependenciesMeta: vite: optional: true dependencies: - vite: 5.0.12(@types/node@20.11.5)(less@4.1.3) + vite: 5.2.6(@types/node@20.11.5)(less@4.1.3) dev: true /vitepress@1.0.0(@types/node@20.11.5)(postcss@8.4.38)(search-insights@2.9.0)(typescript@5.2.2): @@ -27456,7 +27686,7 @@ packages: '@shikijs/core': 1.2.4 '@shikijs/transformers': 1.2.4 '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 5.0.4(vite@5.0.12)(vue@3.4.21) + '@vitejs/plugin-vue': 5.0.4(vite@5.2.6)(vue@3.4.21) '@vue/devtools-api': 7.0.25(vue@3.4.21) '@vueuse/core': 10.9.0(vue@3.4.21) '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.21) diff --git a/test/benchmark/test/base.bench.ts b/test/benchmark/fixtures/basic/base.bench.ts similarity index 85% rename from test/benchmark/test/base.bench.ts rename to test/benchmark/fixtures/basic/base.bench.ts index 9d2fc8851478..872f214c7f79 100644 --- a/test/benchmark/test/base.bench.ts +++ b/test/benchmark/fixtures/basic/base.bench.ts @@ -38,22 +38,30 @@ describe('timeout', () => { teardown() { }, + ...benchOptions }) bench('timeout75', async () => { await timeout(75) - }) + }, benchOptions) bench('timeout50', async () => { await timeout(50) - }) + }, benchOptions) bench('timeout25', async () => { await timeout(25) - }) + }, benchOptions) // TODO: move to failed tests // test('reduce', () => { // expect(1 - 1).toBe(2) // }) }) + +const benchOptions = { + time: 0, + iterations: 3, + warmupIterations: 0, + warmupTime: 0, +} diff --git a/test/benchmark/test/mode.bench.ts b/test/benchmark/fixtures/basic/mode.bench.ts similarity index 100% rename from test/benchmark/test/mode.bench.ts rename to test/benchmark/fixtures/basic/mode.bench.ts diff --git a/test/benchmark/test/only.bench.ts b/test/benchmark/fixtures/basic/only.bench.ts similarity index 100% rename from test/benchmark/test/only.bench.ts rename to test/benchmark/fixtures/basic/only.bench.ts diff --git a/test/benchmark/fixtures/basic/vitest.config.ts b/test/benchmark/fixtures/basic/vitest.config.ts new file mode 100644 index 000000000000..abed6b2116e1 --- /dev/null +++ b/test/benchmark/fixtures/basic/vitest.config.ts @@ -0,0 +1,3 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({}) diff --git a/test/benchmark/fixtures/reporter/summary.bench.ts b/test/benchmark/fixtures/reporter/summary.bench.ts new file mode 100644 index 000000000000..d61e094276bd --- /dev/null +++ b/test/benchmark/fixtures/reporter/summary.bench.ts @@ -0,0 +1,32 @@ +import { bench, describe } from 'vitest' + +describe('suite-a', () => { + bench('good', async () => { + await sleep(10) + }, options) + + bench('bad', async () => { + await sleep(300) + }, options) +}) + +describe('suite-b', () => { + bench('good', async () => { + await sleep(25) + }, options) + + describe('suite-b-nested', () => { + bench('good', async () => { + await sleep(50) + }, options) + }) +}) + +const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); + +const options = { + time: 0, + iterations: 2, + warmupIterations: 0, + warmupTime: 0, +} diff --git a/test/benchmark/fixtures/reporter/vitest.config.ts b/test/benchmark/fixtures/reporter/vitest.config.ts new file mode 100644 index 000000000000..abed6b2116e1 --- /dev/null +++ b/test/benchmark/fixtures/reporter/vitest.config.ts @@ -0,0 +1,3 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({}) diff --git a/test/benchmark/fixtures/sequential/f1.bench.ts b/test/benchmark/fixtures/sequential/f1.bench.ts new file mode 100644 index 000000000000..acf940fae47b --- /dev/null +++ b/test/benchmark/fixtures/sequential/f1.bench.ts @@ -0,0 +1,26 @@ +import { bench, describe } from "vitest" +import { appendLog, benchOptions, sleepBench } from "./helper"; + +bench("B1", async () => { + await appendLog("F1 / B1") + await sleepBench(); +}, benchOptions) + +describe("S1", () => { + bench("B1", async () => { + await appendLog("F1 / S1 / B1") + await sleepBench(); + }, benchOptions) + + bench("B2", async () => { + await appendLog("F1 / S1 / B2") + await sleepBench(); + }, benchOptions) +}) + +describe("S2", () => { + bench("B1", async () => { + await appendLog("F1 / S2 / B1") + await sleepBench(); + }, benchOptions) +}) diff --git a/test/benchmark/fixtures/sequential/f2.bench.ts b/test/benchmark/fixtures/sequential/f2.bench.ts new file mode 100644 index 000000000000..3968708f7a8b --- /dev/null +++ b/test/benchmark/fixtures/sequential/f2.bench.ts @@ -0,0 +1,9 @@ +import { bench, describe } from "vitest" +import { appendLog, benchOptions, sleepBench } from "./helper"; + +describe("S1", () => { + bench("B1", async () => { + await appendLog("F2 / S1 / B1") + await sleepBench(); + }, benchOptions) +}) diff --git a/test/benchmark/fixtures/sequential/helper.ts b/test/benchmark/fixtures/sequential/helper.ts new file mode 100644 index 000000000000..b609d7c9375c --- /dev/null +++ b/test/benchmark/fixtures/sequential/helper.ts @@ -0,0 +1,19 @@ +import fs from "node:fs"; + +const SLEEP_BENCH_MS = Number(process.env["SLEEP_BENCH_MS"] || 10); +const BENCH_ITERATIONS = Number(process.env["BENCH_ITERATIONS"] || 3); + +export const sleepBench = () => new Promise(resolve => setTimeout(resolve, SLEEP_BENCH_MS)) + +export const testLogFile = new URL("./test.log", import.meta.url); + +export async function appendLog(data: string) { + await fs.promises.appendFile(testLogFile, data + "\n"); +} + +export const benchOptions = { + time: 0, + iterations: BENCH_ITERATIONS, + warmupIterations: 0, + warmupTime: 0, +} diff --git a/test/benchmark/fixtures/sequential/setup.ts b/test/benchmark/fixtures/sequential/setup.ts new file mode 100644 index 000000000000..9a929fa54cad --- /dev/null +++ b/test/benchmark/fixtures/sequential/setup.ts @@ -0,0 +1,6 @@ +import fs from "node:fs"; +import { testLogFile } from "./helper"; + +export default async function setup() { + await fs.promises.rm(testLogFile, { force: true }); +} diff --git a/test/benchmark/fixtures/sequential/vitest.config.ts b/test/benchmark/fixtures/sequential/vitest.config.ts new file mode 100644 index 000000000000..fe63b73cf264 --- /dev/null +++ b/test/benchmark/fixtures/sequential/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from "vitest/config" + +// to see the difference better, increase sleep time and iterations e.g. by +// SLEEP_BENCH_MS=100 pnpm -C test/benchmark test bench -- --root fixtures/sequential --fileParallelism + +export default defineConfig({ + test: { + globalSetup: ["./setup.ts"] + } +}); diff --git a/test/benchmark/package.json b/test/benchmark/package.json index 2e72a0df4901..5566080b1da6 100644 --- a/test/benchmark/package.json +++ b/test/benchmark/package.json @@ -1,11 +1,9 @@ { - "name": "@vitest/benchmark", + "name": "@vitest/benchmark-sequential", "type": "module", "private": true, "scripts": { - "test": "node --test specs/* && echo '1'", - "bench:json": "vitest bench --reporter=json", - "bench": "vitest bench" + "test": "vitest" }, "devDependencies": { "vitest": "workspace:*" diff --git a/test/benchmark/specs/runner.test.mjs b/test/benchmark/specs/runner.test.mjs deleted file mode 100644 index 0a53b7ab05a4..000000000000 --- a/test/benchmark/specs/runner.test.mjs +++ /dev/null @@ -1,40 +0,0 @@ -import { existsSync, rmSync } from 'node:fs' -import * as assert from 'node:assert' -import { readFile } from 'node:fs/promises' -import test from 'node:test' -import { startVitest } from 'vitest/node' - -if (existsSync('./bench.json')) - rmSync('./bench.json') - -try { - await startVitest('benchmark', ['base.bench', 'mode.bench', 'only.bench'], { - watch: false, - }) -} -catch (error) { - console.error(error) - process.exit(1) -} - -const benchResult = await readFile('./bench.json', 'utf-8') -const resultJson = JSON.parse(benchResult) - -await test('benchmarks are actually running', async () => { - assert.ok(resultJson.testResults.sort, 'sort is in results') - assert.ok(resultJson.testResults.timeout, 'timeout is in results') - assert.ok(resultJson.testResults.a0, 'a0 is in results') - assert.ok(resultJson.testResults.c1, 'c1 is in results') - assert.ok(resultJson.testResults.a2, 'a2 is in results') - assert.ok(resultJson.testResults.b3, 'b3 is in results') - assert.ok(resultJson.testResults.b4, 'b4 is in results') -}) - -await test('doesn\'t have skipped tests', () => { - assert.doesNotMatch(benchResult, /skip/, 'contains skipped benchmarks') - - const skippedBenches = ['s0', 's1', 's2', 's3', 'sb4', 's4'] - const todoBenches = ['unimplemented suite', 'unimplemented test'] - - assert.ok(skippedBenches.concat(todoBenches).every(b => !benchResult.includes(b)), 'contains skipped benchmarks') -}) diff --git a/test/benchmark/test/__snapshots__/reporter.test.ts.snap b/test/benchmark/test/__snapshots__/reporter.test.ts.snap new file mode 100644 index 000000000000..a851206d5b34 --- /dev/null +++ b/test/benchmark/test/__snapshots__/reporter.test.ts.snap @@ -0,0 +1,14 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`summary 1`] = ` +" + + good - summary.bench.ts > suite-a + (?) faster than bad + + good - summary.bench.ts > suite-b + + good - summary.bench.ts > suite-b > suite-b-nested + +" +`; diff --git a/test/benchmark/test/__snapshots__/sequential.test.ts.snap b/test/benchmark/test/__snapshots__/sequential.test.ts.snap new file mode 100644 index 000000000000..6c7ec14b6d45 --- /dev/null +++ b/test/benchmark/test/__snapshots__/sequential.test.ts.snap @@ -0,0 +1,20 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`sequential 1`] = ` +"F1 / S1 / B1 +F1 / S1 / B1 +F1 / S1 / B1 +F1 / S1 / B2 +F1 / S1 / B2 +F1 / S1 / B2 +F1 / S2 / B1 +F1 / S2 / B1 +F1 / S2 / B1 +F1 / B1 +F1 / B1 +F1 / B1 +F2 / S1 / B1 +F2 / S1 / B1 +F2 / S1 / B1 +" +`; diff --git a/test/benchmark/test/basic.test.ts b/test/benchmark/test/basic.test.ts new file mode 100644 index 000000000000..46021e7483f4 --- /dev/null +++ b/test/benchmark/test/basic.test.ts @@ -0,0 +1,38 @@ +import fs from 'node:fs' +import { expect, it } from 'vitest' +import * as pathe from 'pathe' +import { runVitest } from '../../test-utils' + +it('basic', { timeout: 60_000 }, async () => { + const root = pathe.join(import.meta.dirname, '../fixtures/basic') + const benchFile = pathe.join(root, 'bench.json') + fs.rmSync(benchFile, { force: true }) + + await runVitest({ + root, + allowOnly: true, + benchmark: { + reporters: 'json', + outputFile: 'bench.json', + }, + }, [], 'benchmark') + + const benchResult = await fs.promises.readFile(benchFile, 'utf-8') + const resultJson = JSON.parse(benchResult) + + expect(Object.keys(resultJson.testResults)).toEqual( + expect.arrayContaining([ + 'sort', + 'timeout', + 'a0', + 'c1', + 'a2', + 'b3', + 'b4', + ]), + ) + + const skipped = ['skip', 's0', 's1', 's2', 's3', 'sb4', 's4', 'unimplemented suite', 'unimplemented test'] + for (const b of skipped) + expect(benchResult).not.toContain(b) +}) diff --git a/test/benchmark/test/reporter.test.ts b/test/benchmark/test/reporter.test.ts new file mode 100644 index 000000000000..35ee2e496a91 --- /dev/null +++ b/test/benchmark/test/reporter.test.ts @@ -0,0 +1,29 @@ +import { expect, it } from 'vitest' +import * as pathe from 'pathe' +import { runVitest } from '../../test-utils' + +it('summary', async () => { + const root = pathe.join(import.meta.dirname, '../fixtures/reporter') + const result = await runVitest({ root }, ['summary.bench.ts'], 'benchmark') + expect(result.stdout).not.toContain('NaNx') + expect(result.stdout.split('BENCH Summary')[1].replaceAll(/[0-9.]+x/g, '(?)')).toMatchSnapshot() +}) + +it('non-tty', async () => { + const root = pathe.join(import.meta.dirname, '../fixtures/basic') + const result = await runVitest({ root }, ['base.bench.ts'], 'benchmark') + const lines = result.stdout.split('\n').slice(3).slice(0, 10) + const expected = `\ + ✓ base.bench.ts > sort + name + · normal + · reverse + ✓ base.bench.ts > timeout + name + · timeout100 + · timeout75 + · timeout50 + · timeout25 +` + expect(lines).toMatchObject(expected.trim().split('\n').map(s => expect.stringContaining(s))) +}) diff --git a/test/benchmark/test/sequential.test.ts b/test/benchmark/test/sequential.test.ts new file mode 100644 index 000000000000..4106d83498cc --- /dev/null +++ b/test/benchmark/test/sequential.test.ts @@ -0,0 +1,11 @@ +import fs from 'node:fs' +import { expect, it } from 'vitest' +import * as pathe from 'pathe' +import { runVitest } from '../../test-utils' + +it('sequential', async () => { + const root = pathe.join(import.meta.dirname, '../fixtures/sequential') + await runVitest({ root }, [], 'benchmark') + const testLog = await fs.promises.readFile(pathe.join(root, 'test.log'), 'utf-8') + expect(testLog).toMatchSnapshot() +}) diff --git a/test/benchmark/vitest.config.ts b/test/benchmark/vitest.config.ts index 790c4797b8e3..abed6b2116e1 100644 --- a/test/benchmark/vitest.config.ts +++ b/test/benchmark/vitest.config.ts @@ -1,25 +1,3 @@ import { defineConfig } from 'vitest/config' -function noop() {} - -export default defineConfig({ - test: { - update: false, - allowOnly: true, - benchmark: { - outputFile: './bench.json', - reporters: ['json', { - onInit: noop, - onPathsCollected: noop, - onCollected: noop, - onFinished: noop, - onTaskUpdate: noop, - onTestRemoved: noop, - onWatcherStart: noop, - onWatcherRerun: noop, - onServerRestart: noop, - onUserConsoleLog: noop, - }], - }, - }, -}) +export default defineConfig({}) diff --git a/test/core/test/diff.test.ts b/test/core/test/diff.test.ts index 18c3f2ec9a98..99b20e123acf 100644 --- a/test/core/test/diff.test.ts +++ b/test/core/test/diff.test.ts @@ -1,6 +1,7 @@ import { expect, test, vi } from 'vitest' import { getDefaultColors, setupColors } from '@vitest/utils' -import { diff } from '@vitest/utils/diff' +import type { DiffOptions } from '@vitest/utils/diff' +import { diff, diffStringsUnified } from '@vitest/utils/diff' import { processError } from '@vitest/runner' import { displayDiff } from '../../../packages/vitest/src/node/error' @@ -24,6 +25,28 @@ test('displays object diff', () => { `) }) +test('display truncated object diff', () => { + const objectA = { a: 1, b: 2, c: 3, d: 4, e: 5 } + const objectB = { a: 1, b: 3, c: 4, d: 5, e: 6 } + const console = { log: vi.fn(), error: vi.fn() } + setupColors(getDefaultColors()) + displayDiff(diff(objectA, objectB, { truncateThreshold: 4 }), console as any) + expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(` + " + - Expected + + Received + + Object { + "a": 1, + - "b": 2, + - "c": 3, + + "b": 3, + + "c": 4, + ... Diff result is truncated + " + `) +}) + test('display one line string diff', () => { const string1 = 'string1' const string2 = 'string2' @@ -41,7 +64,24 @@ test('display one line string diff', () => { `) }) -test('display multiline line string diff', () => { +test('display one line string diff should not be affected by truncateThreshold', () => { + const string1 = 'string1' + const string2 = 'string2' + const console = { log: vi.fn(), error: vi.fn() } + setupColors(getDefaultColors()) + displayDiff(diff(string1, string2, { truncateThreshold: 3 }), console as any) + expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(` + " + - Expected + + Received + + - string1 + + string2 + " + `) +}) + +test('display multiline string diff', () => { const string1 = 'string1\nstring2\nstring3' const string2 = 'string2\nstring2\nstring1' const console = { log: vi.fn(), error: vi.fn() } @@ -61,6 +101,46 @@ test('display multiline line string diff', () => { `) }) +test('display truncated multiline string diff', () => { + const string1 = 'string1\nstring2\nstring3' + const string2 = 'string2\nstring2\nstring1' + const console = { log: vi.fn(), error: vi.fn() } + setupColors(getDefaultColors()) + displayDiff(diff(string1, string2, { truncateThreshold: 2 }), console as any) + expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(` + " + - Expected + + Received + + - string1 + + string2 + string2 + ... Diff result is truncated + " + `) +}) + +test('display truncated multiple items array diff', () => { + const array1 = Array(45000).fill('foo') + const array2 = Array(45000).fill('bar') + const console = { log: vi.fn(), error: vi.fn() } + setupColors(getDefaultColors()) + displayDiff(diff(array1, array2, { truncateThreshold: 3 }), console as any) + expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(` + " + - Expected + + Received + + Array [ + - "foo", + - "foo", + + "bar", + + "bar", + ... Diff result is truncated + " + `) +}) + test('asymmetric matcher in object', () => { setupColors(getDefaultColors()) expect(getErrorDiff({ x: 0, y: 'foo' }, { x: 1, y: expect.anything() })).toMatchInlineSnapshot(` @@ -75,6 +155,26 @@ test('asymmetric matcher in object', () => { `) }) +test('asymmetric matcher in object with truncated diff', () => { + setupColors(getDefaultColors()) + expect( + getErrorDiff( + { w: 'foo', x: 0, y: 'bar', z: 'baz' }, + { w: expect.anything(), x: 1, y: expect.anything(), z: 'bar' }, + { truncateThreshold: 3 }, + ), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + Object { + "w": Anything, + - "x": 1, + + "x": 0, + ... Diff result is truncated" + `) +}) + test('asymmetric matcher in array', () => { setupColors(getDefaultColors()) expect(getErrorDiff([0, 'foo'], [1, expect.anything()])).toMatchInlineSnapshot(` @@ -89,6 +189,25 @@ test('asymmetric matcher in array', () => { `) }) +test('asymmetric matcher in array with truncated diff', () => { + setupColors(getDefaultColors()) + expect( + getErrorDiff( + [0, 'foo', 2], + [1, expect.anything(), 3], + { truncateThreshold: 2 }, + ), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + Array [ + - 1, + + 0, + ... Diff result is truncated" + `) +}) + test('asymmetric matcher in nested', () => { setupColors(getDefaultColors()) expect( @@ -115,12 +234,112 @@ test('asymmetric matcher in nested', () => { `) }) -function getErrorDiff(actual: unknown, expected: unknown) { +test('asymmetric matcher in nested with truncated diff', () => { + setupColors(getDefaultColors()) + expect( + getErrorDiff( + [{ x: 0, y: 'foo', z: 'bar' }, [0, 'bar', 'baz']], + [{ x: 1, y: expect.anything(), z: expect.anything() }, [1, expect.anything(), expect.anything()]], + { truncateThreshold: 5 }, + ), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + Array [ + Object { + - "x": 1, + + "x": 0, + "y": Anything, + "z": Anything, + ... Diff result is truncated" + `) +}) + +test('diff for multi-line string compared by characters', () => { + const string1 = ` + foo, + bar, + ` + const string2 = ` + FOO, + bar, + ` + setupColors(getDefaultColors()) + expect( + diffStringsUnified(string1, string2), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + + - foo, + + FOO, + bar, + " + `) +}) + +test('truncated diff for multi-line string compared by characters', () => { + const string1 = ` + foo, + bar, + baz, + ` + const string2 = ` + FOO, + bar, + BAZ, + ` + setupColors(getDefaultColors()) + expect( + diffStringsUnified(string1, string2, { truncateThreshold: 3 }), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + + - foo, + + FOO, + bar, + ... Diff result is truncated" + `) +}) + +test('getter only property', () => { + setupColors(getDefaultColors()) + const x = { normalProp: 1 } + const y = { normalProp: 2 } + Object.defineProperty(x, 'getOnlyProp', { + enumerable: true, + get: () => ({ a: 'b' }), + }) + Object.defineProperty(y, 'getOnlyProp', { + enumerable: true, + get: () => ({ a: 'b' }), + }) + expect( + getErrorDiff(x, y), + ).toMatchInlineSnapshot(` + "- Expected + + Received + + Object { + "getOnlyProp": Object { + "a": "b", + }, + - "normalProp": 2, + + "normalProp": 1, + }" + `) +}) + +function getErrorDiff(actual: unknown, expected: unknown, options?: DiffOptions) { try { expect(actual).toEqual(expected) } catch (e) { - const error = processError(e) + const error = processError(e, options) return error.diff } expect.unreachable() diff --git a/test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap b/test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap index 4ce5f2804de4..ec7ed93f4a90 100644 --- a/test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap +++ b/test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap @@ -1134,6 +1134,256 @@ exports[`istanbul json report 1`] = ` }, }, }, + "/src/empty-lines.ts": { + "b": { + "0": [ + 0, + 0, + ], + "1": [ + 0, + 0, + ], + "2": [ + 0, + 0, + ], + "3": [ + 0, + 0, + ], + }, + "branchMap": { + "0": { + "loc": { + "end": { + "column": null, + "line": 11, + }, + "start": { + "column": 2, + "line": 8, + }, + }, + "locations": [ + { + "end": { + "column": null, + "line": 11, + }, + "start": { + "column": 2, + "line": 8, + }, + }, + { + "end": { + "column": null, + "line": 11, + }, + "start": { + "column": 2, + "line": 8, + }, + }, + ], + "type": "if", + }, + "1": { + "loc": { + "end": { + "column": 26, + "line": 8, + }, + "start": { + "column": 6, + "line": 8, + }, + }, + "locations": [ + { + "end": { + "column": 17, + "line": 8, + }, + "start": { + "column": 6, + "line": 8, + }, + }, + { + "end": { + "column": 26, + "line": 8, + }, + "start": { + "column": 17, + "line": 8, + }, + }, + ], + "type": "binary-expr", + }, + "2": { + "loc": { + "end": { + "column": null, + "line": 18, + }, + "start": { + "column": 2, + "line": 15, + }, + }, + "locations": [ + { + "end": { + "column": null, + "line": 18, + }, + "start": { + "column": 2, + "line": 15, + }, + }, + { + "end": { + "column": null, + "line": 18, + }, + "start": { + "column": 2, + "line": 15, + }, + }, + ], + "type": "if", + }, + "3": { + "loc": { + "end": { + "column": 26, + "line": 15, + }, + "start": { + "column": 6, + "line": 15, + }, + }, + "locations": [ + { + "end": { + "column": 17, + "line": 15, + }, + "start": { + "column": 6, + "line": 15, + }, + }, + { + "end": { + "column": 26, + "line": 15, + }, + "start": { + "column": 17, + "line": 15, + }, + }, + ], + "type": "binary-expr", + }, + }, + "f": { + "0": 0, + }, + "fnMap": { + "0": { + "decl": { + "end": { + "column": 20, + "line": 2, + }, + "start": { + "column": 16, + "line": 2, + }, + }, + "loc": { + "end": { + "column": null, + "line": 29, + }, + "start": { + "column": 42, + "line": 2, + }, + }, + "name": "add", + }, + }, + "path": "/src/empty-lines.ts", + "s": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + }, + "statementMap": { + "0": { + "end": { + "column": null, + "line": 11, + }, + "start": { + "column": 2, + "line": 8, + }, + }, + "1": { + "end": { + "column": null, + "line": 10, + }, + "start": { + "column": 4, + "line": 10, + }, + }, + "2": { + "end": { + "column": null, + "line": 18, + }, + "start": { + "column": 2, + "line": 15, + }, + }, + "3": { + "end": { + "column": null, + "line": 17, + }, + "start": { + "column": 4, + "line": 17, + }, + }, + "4": { + "end": { + "column": null, + "line": 28, + }, + "start": { + "column": 2, + "line": 28, + }, + }, + }, + }, "/src/file-to-change.ts": { "b": {}, "branchMap": {}, @@ -2702,32 +2952,32 @@ exports[`istanbul json report 1`] = ` "loc": { "end": { "column": null, - "line": 24, + "line": 36, }, "start": { "column": 2, - "line": 21, + "line": 33, }, }, "locations": [ { "end": { "column": null, - "line": 24, + "line": 36, }, "start": { "column": 2, - "line": 21, + "line": 33, }, }, { "end": { "column": null, - "line": 24, + "line": 36, }, "start": { "column": 2, - "line": 21, + "line": 33, }, }, ], @@ -2737,32 +2987,32 @@ exports[`istanbul json report 1`] = ` "loc": { "end": { "column": null, - "line": 29, + "line": 42, }, "start": { "column": 2, - "line": 26, + "line": 39, }, }, "locations": [ { "end": { "column": null, - "line": 29, + "line": 42, }, "start": { "column": 2, - "line": 26, + "line": 39, }, }, { "end": { "column": null, - "line": 29, + "line": 42, }, "start": { "column": 2, - "line": 26, + "line": 39, }, }, ], @@ -2780,21 +3030,21 @@ exports[`istanbul json report 1`] = ` "decl": { "end": { "column": 39, - "line": 6, + "line": 8, }, "start": { "column": 24, - "line": 6, + "line": 8, }, }, "loc": { "end": { "column": null, - "line": 8, + "line": 10, }, "start": { "column": 39, - "line": 6, + "line": 8, }, }, "name": "untestedFile", @@ -2803,21 +3053,21 @@ exports[`istanbul json report 1`] = ` "decl": { "end": { "column": 13, - "line": 10, + "line": 12, }, "start": { "column": 9, - "line": 10, + "line": 12, }, }, "loc": { "end": { "column": null, - "line": 13, + "line": 15, }, "start": { "column": 35, - "line": 10, + "line": 12, }, }, "name": "add", @@ -2826,21 +3076,21 @@ exports[`istanbul json report 1`] = ` "decl": { "end": { "column": 18, - "line": 15, + "line": 19, }, "start": { "column": 9, - "line": 15, + "line": 19, }, }, "loc": { "end": { "column": null, - "line": 18, + "line": 22, }, "start": { "column": 40, - "line": 15, + "line": 19, }, }, "name": "multiply", @@ -2849,21 +3099,21 @@ exports[`istanbul json report 1`] = ` "decl": { "end": { "column": 21, - "line": 20, + "line": 24, }, "start": { "column": 16, - "line": 20, + "line": 24, }, }, "loc": { "end": { "column": null, - "line": 33, + "line": 47, }, "start": { "column": 64, - "line": 20, + "line": 24, }, }, "name": "math", @@ -2884,81 +3134,81 @@ exports[`istanbul json report 1`] = ` "0": { "end": { "column": null, - "line": 7, + "line": 9, }, "start": { "column": 2, - "line": 7, + "line": 9, }, }, "1": { "end": { "column": null, - "line": 12, + "line": 14, }, "start": { "column": 2, - "line": 12, + "line": 14, }, }, "2": { "end": { "column": null, - "line": 17, + "line": 21, }, "start": { "column": 2, - "line": 17, + "line": 21, }, }, "3": { "end": { "column": null, - "line": 24, + "line": 36, }, "start": { "column": 2, - "line": 21, + "line": 33, }, }, "4": { "end": { "column": null, - "line": 23, + "line": 35, }, "start": { "column": 4, - "line": 23, + "line": 35, }, }, "5": { "end": { "column": null, - "line": 29, + "line": 42, }, "start": { "column": 2, - "line": 26, + "line": 39, }, }, "6": { "end": { "column": null, - "line": 28, + "line": 41, }, "start": { "column": 4, - "line": 28, + "line": 41, }, }, "7": { "end": { "column": null, - "line": 32, + "line": 46, }, "start": { "column": 2, - "line": 32, + "line": 46, }, }, }, diff --git a/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap b/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap index cd0ff16fdc7d..326c2b7f6b93 100644 --- a/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap +++ b/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap @@ -2777,6 +2777,395 @@ exports[`v8 json report 1`] = ` }, }, }, + "/src/empty-lines.ts": { + "all": true, + "b": { + "0": [ + 0, + ], + }, + "branchMap": { + "0": { + "line": 1, + "loc": { + "end": { + "column": 1, + "line": 29, + }, + "start": { + "column": 478, + "line": 1, + }, + }, + "locations": [ + { + "end": { + "column": 1, + "line": 29, + }, + "start": { + "column": 478, + "line": 1, + }, + }, + ], + "type": "branch", + }, + }, + "f": { + "0": 0, + }, + "fnMap": { + "0": { + "decl": { + "end": { + "column": 1, + "line": 29, + }, + "start": { + "column": 478, + "line": 1, + }, + }, + "line": 1, + "loc": { + "end": { + "column": 1, + "line": 29, + }, + "start": { + "column": 478, + "line": 1, + }, + }, + "name": "(empty-report)", + }, + }, + "path": "/src/empty-lines.ts", + "s": { + "0": 0, + "1": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0, + "19": 0, + "2": 0, + "20": 0, + "21": 0, + "22": 0, + "23": 0, + "24": 0, + "25": 0, + "26": 0, + "27": 0, + "28": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + }, + "statementMap": { + "0": { + "end": { + "column": 65, + "line": 1, + }, + "start": { + "column": 0, + "line": 1, + }, + }, + "1": { + "end": { + "column": 43, + "line": 2, + }, + "start": { + "column": 0, + "line": 2, + }, + }, + "10": { + "end": { + "column": 3, + "line": 11, + }, + "start": { + "column": 0, + "line": 11, + }, + }, + "11": { + "end": { + "column": 0, + "line": 12, + }, + "start": { + "column": 0, + "line": 12, + }, + }, + "12": { + "end": { + "column": 32, + "line": 13, + }, + "start": { + "column": 0, + "line": 13, + }, + }, + "13": { + "end": { + "column": 0, + "line": 14, + }, + "start": { + "column": 0, + "line": 14, + }, + }, + "14": { + "end": { + "column": 27, + "line": 15, + }, + "start": { + "column": 0, + "line": 15, + }, + }, + "15": { + "end": { + "column": 38, + "line": 16, + }, + "start": { + "column": 0, + "line": 16, + }, + }, + "16": { + "end": { + "column": 12, + "line": 17, + }, + "start": { + "column": 0, + "line": 17, + }, + }, + "17": { + "end": { + "column": 3, + "line": 18, + }, + "start": { + "column": 0, + "line": 18, + }, + }, + "18": { + "end": { + "column": 0, + "line": 19, + }, + "start": { + "column": 0, + "line": 19, + }, + }, + "19": { + "end": { + "column": 33, + "line": 20, + }, + "start": { + "column": 0, + "line": 20, + }, + }, + "2": { + "end": { + "column": 5, + "line": 3, + }, + "start": { + "column": 0, + "line": 3, + }, + }, + "20": { + "end": { + "column": 13, + "line": 21, + }, + "start": { + "column": 0, + "line": 21, + }, + }, + "21": { + "end": { + "column": 11, + "line": 22, + }, + "start": { + "column": 0, + "line": 22, + }, + }, + "22": { + "end": { + "column": 22, + "line": 23, + }, + "start": { + "column": 0, + "line": 23, + }, + }, + "23": { + "end": { + "column": 7, + "line": 24, + }, + "start": { + "column": 0, + "line": 24, + }, + }, + "24": { + "end": { + "column": 5, + "line": 25, + }, + "start": { + "column": 0, + "line": 25, + }, + }, + "25": { + "end": { + "column": 3, + "line": 26, + }, + "start": { + "column": 0, + "line": 26, + }, + }, + "26": { + "end": { + "column": 0, + "line": 27, + }, + "start": { + "column": 0, + "line": 27, + }, + }, + "27": { + "end": { + "column": 14, + "line": 28, + }, + "start": { + "column": 0, + "line": 28, + }, + }, + "28": { + "end": { + "column": 1, + "line": 29, + }, + "start": { + "column": 0, + "line": 29, + }, + }, + "3": { + "end": { + "column": 10, + "line": 4, + }, + "start": { + "column": 0, + "line": 4, + }, + }, + "4": { + "end": { + "column": 9, + "line": 5, + }, + "start": { + "column": 0, + "line": 5, + }, + }, + "5": { + "end": { + "column": 12, + "line": 6, + }, + "start": { + "column": 0, + "line": 6, + }, + }, + "6": { + "end": { + "column": 5, + "line": 7, + }, + "start": { + "column": 0, + "line": 7, + }, + }, + "7": { + "end": { + "column": 27, + "line": 8, + }, + "start": { + "column": 0, + "line": 8, + }, + }, + "8": { + "end": { + "column": 38, + "line": 9, + }, + "start": { + "column": 0, + "line": 9, + }, + }, + "9": { + "end": { + "column": 12, + "line": 10, + }, + "start": { + "column": 0, + "line": 10, + }, + }, + }, + }, "/src/file-to-change.ts": { "all": true, "b": { @@ -2793,7 +3182,7 @@ exports[`v8 json report 1`] = ` "line": 7, }, "start": { - "column": 0, + "column": 133, "line": 1, }, }, @@ -2804,7 +3193,7 @@ exports[`v8 json report 1`] = ` "line": 7, }, "start": { - "column": 0, + "column": 133, "line": 1, }, }, @@ -2823,7 +3212,7 @@ exports[`v8 json report 1`] = ` "line": 7, }, "start": { - "column": 0, + "column": 133, "line": 1, }, }, @@ -2834,7 +3223,7 @@ exports[`v8 json report 1`] = ` "line": 7, }, "start": { - "column": 0, + "column": 133, "line": 1, }, }, @@ -5306,10 +5695,10 @@ exports[`v8 json report 1`] = ` "loc": { "end": { "column": 1, - "line": 33, + "line": 47, }, "start": { - "column": 0, + "column": 984, "line": 1, }, }, @@ -5317,10 +5706,10 @@ exports[`v8 json report 1`] = ` { "end": { "column": 1, - "line": 33, + "line": 47, }, "start": { - "column": 0, + "column": 984, "line": 1, }, }, @@ -5336,10 +5725,10 @@ exports[`v8 json report 1`] = ` "decl": { "end": { "column": 1, - "line": 33, + "line": 47, }, "start": { - "column": 0, + "column": 984, "line": 1, }, }, @@ -5347,10 +5736,10 @@ exports[`v8 json report 1`] = ` "loc": { "end": { "column": 1, - "line": 33, + "line": 47, }, "start": { - "column": 0, + "column": 984, "line": 1, }, }, @@ -5386,7 +5775,15 @@ exports[`v8 json report 1`] = ` "30": 0, "31": 0, "32": 0, + "33": 0, + "34": 0, + "35": 0, + "36": 0, "4": 0, + "43": 0, + "44": 0, + "45": 0, + "46": 0, "5": 0, "6": 0, "7": 0, @@ -5416,7 +5813,7 @@ exports[`v8 json report 1`] = ` }, "10": { "end": { - "column": 36, + "column": 0, "line": 11, }, "start": { @@ -5426,7 +5823,7 @@ exports[`v8 json report 1`] = ` }, "11": { "end": { - "column": 14, + "column": 36, "line": 12, }, "start": { @@ -5436,7 +5833,7 @@ exports[`v8 json report 1`] = ` }, "12": { "end": { - "column": 1, + "column": 36, "line": 13, }, "start": { @@ -5446,7 +5843,7 @@ exports[`v8 json report 1`] = ` }, "13": { "end": { - "column": 0, + "column": 14, "line": 14, }, "start": { @@ -5456,7 +5853,7 @@ exports[`v8 json report 1`] = ` }, "14": { "end": { - "column": 41, + "column": 1, "line": 15, }, "start": { @@ -5466,7 +5863,7 @@ exports[`v8 json report 1`] = ` }, "15": { "end": { - "column": 36, + "column": 0, "line": 16, }, "start": { @@ -5476,7 +5873,7 @@ exports[`v8 json report 1`] = ` }, "16": { "end": { - "column": 14, + "column": 30, "line": 17, }, "start": { @@ -5486,7 +5883,7 @@ exports[`v8 json report 1`] = ` }, "17": { "end": { - "column": 1, + "column": 0, "line": 18, }, "start": { @@ -5496,7 +5893,7 @@ exports[`v8 json report 1`] = ` }, "18": { "end": { - "column": 0, + "column": 41, "line": 19, }, "start": { @@ -5506,7 +5903,7 @@ exports[`v8 json report 1`] = ` }, "19": { "end": { - "column": 65, + "column": 36, "line": 20, }, "start": { @@ -5526,7 +5923,7 @@ exports[`v8 json report 1`] = ` }, "20": { "end": { - "column": 25, + "column": 14, "line": 21, }, "start": { @@ -5536,7 +5933,7 @@ exports[`v8 json report 1`] = ` }, "21": { "end": { - "column": 38, + "column": 1, "line": 22, }, "start": { @@ -5546,7 +5943,7 @@ exports[`v8 json report 1`] = ` }, "22": { "end": { - "column": 25, + "column": 0, "line": 23, }, "start": { @@ -5556,7 +5953,7 @@ exports[`v8 json report 1`] = ` }, "23": { "end": { - "column": 3, + "column": 65, "line": 24, }, "start": { @@ -5566,7 +5963,7 @@ exports[`v8 json report 1`] = ` }, "24": { "end": { - "column": 0, + "column": 33, "line": 25, }, "start": { @@ -5576,7 +5973,7 @@ exports[`v8 json report 1`] = ` }, "25": { "end": { - "column": 25, + "column": 13, "line": 26, }, "start": { @@ -5586,7 +5983,7 @@ exports[`v8 json report 1`] = ` }, "26": { "end": { - "column": 38, + "column": 11, "line": 27, }, "start": { @@ -5596,7 +5993,7 @@ exports[`v8 json report 1`] = ` }, "27": { "end": { - "column": 20, + "column": 22, "line": 28, }, "start": { @@ -5606,7 +6003,7 @@ exports[`v8 json report 1`] = ` }, "28": { "end": { - "column": 3, + "column": 7, "line": 29, }, "start": { @@ -5616,7 +6013,7 @@ exports[`v8 json report 1`] = ` }, "29": { "end": { - "column": 0, + "column": 5, "line": 30, }, "start": { @@ -5636,7 +6033,7 @@ exports[`v8 json report 1`] = ` }, "30": { "end": { - "column": 36, + "column": 3, "line": 31, }, "start": { @@ -5646,7 +6043,7 @@ exports[`v8 json report 1`] = ` }, "31": { "end": { - "column": 41, + "column": 0, "line": 32, }, "start": { @@ -5656,7 +6053,7 @@ exports[`v8 json report 1`] = ` }, "32": { "end": { - "column": 1, + "column": 25, "line": 33, }, "start": { @@ -5664,6 +6061,46 @@ exports[`v8 json report 1`] = ` "line": 33, }, }, + "33": { + "end": { + "column": 38, + "line": 34, + }, + "start": { + "column": 0, + "line": 34, + }, + }, + "34": { + "end": { + "column": 25, + "line": 35, + }, + "start": { + "column": 0, + "line": 35, + }, + }, + "35": { + "end": { + "column": 3, + "line": 36, + }, + "start": { + "column": 0, + "line": 36, + }, + }, + "36": { + "end": { + "column": 0, + "line": 37, + }, + "start": { + "column": 0, + "line": 37, + }, + }, "4": { "end": { "column": 0, @@ -5674,9 +6111,49 @@ exports[`v8 json report 1`] = ` "line": 5, }, }, + "43": { + "end": { + "column": 0, + "line": 44, + }, + "start": { + "column": 0, + "line": 44, + }, + }, + "44": { + "end": { + "column": 36, + "line": 45, + }, + "start": { + "column": 0, + "line": 45, + }, + }, + "45": { + "end": { + "column": 41, + "line": 46, + }, + "start": { + "column": 0, + "line": 46, + }, + }, + "46": { + "end": { + "column": 1, + "line": 47, + }, + "start": { + "column": 0, + "line": 47, + }, + }, "5": { "end": { - "column": 40, + "column": 65, "line": 6, }, "start": { @@ -5686,7 +6163,7 @@ exports[`v8 json report 1`] = ` }, "6": { "end": { - "column": 72, + "column": 0, "line": 7, }, "start": { @@ -5696,7 +6173,7 @@ exports[`v8 json report 1`] = ` }, "7": { "end": { - "column": 1, + "column": 40, "line": 8, }, "start": { @@ -5706,7 +6183,7 @@ exports[`v8 json report 1`] = ` }, "8": { "end": { - "column": 0, + "column": 72, "line": 9, }, "start": { @@ -5716,7 +6193,7 @@ exports[`v8 json report 1`] = ` }, "9": { "end": { - "column": 36, + "column": 1, "line": 10, }, "start": { @@ -6022,11 +6499,6 @@ exports[`v8 json report 1`] = ` "22": 0, "23": 0, "24": 1, - "25": 1, - "26": 1, - "27": 1, - "28": 1, - "29": 1, "3": 1, "4": 1, "5": 2, @@ -6216,56 +6688,6 @@ exports[`v8 json report 1`] = ` "line": 25, }, }, - "25": { - "end": { - "column": 22, - "line": 26, - }, - "start": { - "column": 0, - "line": 26, - }, - }, - "26": { - "end": { - "column": 39, - "line": 27, - }, - "start": { - "column": 0, - "line": 27, - }, - }, - "27": { - "end": { - "column": 35, - "line": 28, - }, - "start": { - "column": 0, - "line": 28, - }, - }, - "28": { - "end": { - "column": 62, - "line": 29, - }, - "start": { - "column": 0, - "line": 29, - }, - }, - "29": { - "end": { - "column": 1, - "line": 30, - }, - "start": { - "column": 0, - "line": 30, - }, - }, "3": { "end": { "column": 0, diff --git a/test/coverage-test/coverage-report-tests/changed.test.ts b/test/coverage-test/coverage-report-tests/changed.test.ts index 20f4602512b2..07481c2dafe5 100644 --- a/test/coverage-test/coverage-report-tests/changed.test.ts +++ b/test/coverage-test/coverage-report-tests/changed.test.ts @@ -7,6 +7,8 @@ test('report contains only the changed files', async () => { const coverageJson = await readCoverageJson('./coverage/coverage-final.json') const coverageMap = libCoverage.createCoverageMap(coverageJson as any) + // Note that this test may fail if you have new files in "vitest/test/coverage-test/src" + // and have not yet committed those expect(coverageMap.files()).toMatchInlineSnapshot(` [ "/src/file-to-change.ts", diff --git a/test/coverage-test/coverage-report-tests/empty-lines.test.ts b/test/coverage-test/coverage-report-tests/empty-lines.test.ts new file mode 100644 index 000000000000..dd405e2971f7 --- /dev/null +++ b/test/coverage-test/coverage-report-tests/empty-lines.test.ts @@ -0,0 +1,108 @@ +import { beforeAll, expect, test } from 'vitest' +import libCoverage from 'istanbul-lib-coverage' + +import { readCoverageJson } from './utils' + +type CoveredLine = 1 +type UncoveredLine = 0 +type IgnoredLine = undefined + +// Key is 1-based line number +type LineCoverage = Record + +let coveredFileLines: LineCoverage +let uncoveredFileLines: LineCoverage + +beforeAll(async () => { + const coverageJson = await readCoverageJson('./coverage/coverage-final.json') + const coverageMap = libCoverage.createCoverageMap(coverageJson as any) + + coveredFileLines = coverageMap.fileCoverageFor('/src/empty-lines.ts').getLineCoverage() as typeof coveredFileLines + uncoveredFileLines = coverageMap.fileCoverageFor('/src/untested-file.ts').getLineCoverage() as typeof uncoveredFileLines +}) + +test('empty lines are ignored', async () => { + expect(coveredFileLines[12]).toBe(undefined) + expect(coveredFileLines[14]).toBe(undefined) + expect(coveredFileLines[19]).toBe(undefined) + expect(coveredFileLines[27]).toBe(undefined) + expect(coveredFileLines[30]).toBe(undefined) + + expect(uncoveredFileLines[5]).toBe(undefined) + expect(uncoveredFileLines[7]).toBe(undefined) +}) + +test('comments are ignored', async () => { + expect(coveredFileLines[1]).toBe(undefined) + expect(coveredFileLines[3]).toBe(undefined) + expect(coveredFileLines[4]).toBe(undefined) + expect(coveredFileLines[5]).toBe(undefined) + expect(coveredFileLines[6]).toBe(undefined) + expect(coveredFileLines[7]).toBe(undefined) + expect(coveredFileLines[9]).toBe(undefined) + expect(coveredFileLines[16]).toBe(undefined) + + expect(uncoveredFileLines[1]).toBe(undefined) + expect(uncoveredFileLines[2]).toBe(undefined) + expect(uncoveredFileLines[3]).toBe(undefined) + expect(uncoveredFileLines[4]).toBe(undefined) + expect(uncoveredFileLines[6]).toBe(undefined) + expect(uncoveredFileLines[13]).toBe(undefined) + expect(uncoveredFileLines[20]).toBe(undefined) + expect(uncoveredFileLines[34]).toBe(undefined) + expect(uncoveredFileLines[45]).toBe(undefined) +}) + +test('ignore hints are ignored', () => { + expect(uncoveredFileLines[38]).toBe(undefined) + expect(uncoveredFileLines[39]).toBe(undefined) + expect(uncoveredFileLines[40]).toBe(undefined) + expect(uncoveredFileLines[41]).toBe(undefined) + expect(uncoveredFileLines[42]).toBe(undefined) + expect(uncoveredFileLines[43]).toBe(undefined) +}) + +test('typescript types are ignored', () => { + expect(coveredFileLines[13]).toBe(undefined) + expect(coveredFileLines[20]).toBe(undefined) + expect(coveredFileLines[21]).toBe(undefined) + expect(coveredFileLines[22]).toBe(undefined) + expect(coveredFileLines[23]).toBe(undefined) + expect(coveredFileLines[24]).toBe(undefined) + expect(coveredFileLines[25]).toBe(undefined) + expect(coveredFileLines[26]).toBe(undefined) + + expect(uncoveredFileLines[17]).toBe(undefined) + expect(uncoveredFileLines[25]).toBe(undefined) + expect(uncoveredFileLines[26]).toBe(undefined) + expect(uncoveredFileLines[27]).toBe(undefined) + expect(uncoveredFileLines[28]).toBe(undefined) + expect(uncoveredFileLines[29]).toBe(undefined) + expect(uncoveredFileLines[30]).toBe(undefined) + expect(uncoveredFileLines[31]).toBe(undefined) +}) + +test('runtime code is not ignored', () => { + // Covered + expect(coveredFileLines[2]).toBe(1) + expect(coveredFileLines[8]).toBe(1) + expect(coveredFileLines[15]).toBe(1) + expect(coveredFileLines[28]).toBe(1) + + // Uncovered + expect(coveredFileLines[10]).toBe(0) + expect(coveredFileLines[17]).toBe(0) + + // Uncovered + expect(uncoveredFileLines[8]).toBe(0) + expect(uncoveredFileLines[9]).toBe(0) + expect(uncoveredFileLines[10]).toBe(0) + expect(uncoveredFileLines[12]).toBe(0) + expect(uncoveredFileLines[14]).toBe(0) + expect(uncoveredFileLines[19]).toBe(0) + expect(uncoveredFileLines[21]).toBe(0) + expect(uncoveredFileLines[24]).toBe(0) + expect(uncoveredFileLines[33]).toBe(0) + expect(uncoveredFileLines[35]).toBe(0) + expect(uncoveredFileLines[46]).toBe(0) +}) diff --git a/test/coverage-test/option-tests/empty-lines.test.ts b/test/coverage-test/option-tests/empty-lines.test.ts new file mode 100644 index 000000000000..2bb4da02326e --- /dev/null +++ b/test/coverage-test/option-tests/empty-lines.test.ts @@ -0,0 +1,7 @@ +import { expect, test } from 'vitest' + +import { add } from '../src/empty-lines' + +test('cover some lines', () => { + expect(add(10, 20)).toBe(30) +}) diff --git a/test/coverage-test/src/empty-lines.ts b/test/coverage-test/src/empty-lines.ts new file mode 100644 index 000000000000..acd18efd2793 --- /dev/null +++ b/test/coverage-test/src/empty-lines.ts @@ -0,0 +1,29 @@ +/* eslint-disable unused-imports/no-unused-vars -- intentional */ +export function add(a: number, b: number) { + /** + * Multi + * line + * comment + */ + if (a === 2 && b === 3) { + // This line should NOT be covered + return 5 + } + + type TypescriptTypings = 1 | 2 + + if (a === 1 && b === 1) { + // This line should NOT be covered + return 2 + } + + interface MoreCompileTimeCode { + should: { + be: { + excluded: true + } + } + } + + return a + b +} diff --git a/test/coverage-test/src/untested-file.ts b/test/coverage-test/src/untested-file.ts index 9b6d86042cc0..cd744e7e9d13 100644 --- a/test/coverage-test/src/untested-file.ts +++ b/test/coverage-test/src/untested-file.ts @@ -3,6 +3,8 @@ * if sourcemaps are off. */ +/* eslint-disable unused-imports/no-unused-vars -- intentional */ + export default function untestedFile() { return 'This file should end up in report when {"all": true} is given' } @@ -12,21 +14,33 @@ function add(a: number, b: number) { return a + b } +type TypescriptTypings = 1 | 2 + function multiply(a: number, b: number) { // This line should NOT be covered return a * b } export function math(a: number, b: number, operator: '*' | '+') { + interface MoreCompileTimeCode { + should: { + be: { + excluded: true + } + } + } + if (operator === '*') { // This line should NOT be covered return multiply(a, b) } + /* v8 ignore start */ if (operator === '+') { - // This line should NOT be covered + // This line should be excluded return add(a, b) } + /* v8 ignore stop */ // This line should NOT be covered throw new Error('Unsupported operator') diff --git a/test/coverage-test/testing-options.mjs b/test/coverage-test/testing-options.mjs index 45bd0d773e6c..7967097703cd 100644 --- a/test/coverage-test/testing-options.mjs +++ b/test/coverage-test/testing-options.mjs @@ -90,10 +90,30 @@ const testCases = [ rmSync('./src/new-uncovered-file.ts') }, }, + { + testConfig: { + name: 'ignore empty lines', + include: ['option-tests/empty-lines.test.ts'], + coverage: { + provider: 'v8', + reporter: 'json', + ignoreEmptyLines: true, + all: true, + include: ['src/empty-lines.ts', 'src/untested-file.ts'], + }, + }, + assertionConfig: { + include: ['coverage-report-tests/empty-lines.test.ts'], + }, + }, ] for (const provider of ['v8', 'istanbul']) { for (const { after, before, testConfig, assertionConfig } of testCases) { + // Test config may specify which provider the test is for + if (testConfig.coverage?.provider && testConfig.coverage.provider !== provider) + continue + await before?.() // Run test case diff --git a/test/filters/test/testname-pattern.test.ts b/test/filters/test/testname-pattern.test.ts index 6a134c6c1615..b6001e69268a 100644 --- a/test/filters/test/testname-pattern.test.ts +++ b/test/filters/test/testname-pattern.test.ts @@ -1,4 +1,4 @@ -import { resolve } from 'pathe' +import { join, resolve } from 'pathe' import { expect, test } from 'vitest' import { runVitest } from '../../test-utils' @@ -30,3 +30,15 @@ test('match by pattern that also matches current working directory', async () => expect(stdout).toMatch('Test Files 1 passed (1)') expect(stdout).not.toMatch('test/example.test.ts') }) + +test.each([ + ['the parent of CWD', resolve(process.cwd(), '..')], + ['the parent of CWD with slash', join(resolve(process.cwd(), '..'), '/')], + ['the parent of a parent of CWD', resolve(process.cwd(), '..', '..')], +])('match by pattern that also matches %s: %s', async (_, filter) => { + const { stdout } = await runVitest({ root: './fixtures' }, [filter]) + + expect(stdout).toMatch('✓ test/filters.test.ts > this will pass') + expect(stdout).toMatch('× test/dont-run-this.test.ts > this will fail') + expect(stdout).toMatch('✓ test/example.test.ts > this will pass') +}) diff --git a/test/optimize-deps/vitest.config.ts b/test/optimize-deps/vitest.config.ts index 00426c41fa22..98485f6ea6e1 100644 --- a/test/optimize-deps/vitest.config.ts +++ b/test/optimize-deps/vitest.config.ts @@ -24,17 +24,4 @@ export default defineConfig({ }, }, }, - // use dummy ssrLoadModule to trigger ssr.optimizeDeps. - // this will be unnecessary from Vite 5.1 - // cf. https://github.com/vitejs/vite/pull/15561 - plugins: [ - { - name: 'force-ssr-optimize-deps', - configureServer(server) { - return async () => { - await server.ssrLoadModule('/package.json') - } - }, - }, - ], }) diff --git a/test/workspaces/.env.local b/test/workspaces/.env.local new file mode 100644 index 000000000000..da9f74ae3621 --- /dev/null +++ b/test/workspaces/.env.local @@ -0,0 +1,4 @@ +VITE_MY_TEST_VARIABLE=core +VITE_CORE_VARIABLE=core +CUSTOM_ROOT=custom +ROOT_VARIABLE=root \ No newline at end of file diff --git a/test/workspaces/globalTest.ts b/test/workspaces/globalTest.ts index 58d9233401cc..5267232fb7e2 100644 --- a/test/workspaces/globalTest.ts +++ b/test/workspaces/globalTest.ts @@ -33,8 +33,8 @@ export async function teardown() { try { assert.ok(results.success) assert.equal(results.numTotalTestSuites, 28) - assert.equal(results.numTotalTests, 29) - assert.equal(results.numPassedTests, 29) + assert.equal(results.numTotalTests, 30) + assert.equal(results.numPassedTests, 30) const shared = results.testResults.filter((r: any) => r.name.includes('space_shared/test.spec.ts')) diff --git a/test/workspaces/space_1/.env.local b/test/workspaces/space_1/.env.local new file mode 100644 index 000000000000..b350e3f42a13 --- /dev/null +++ b/test/workspaces/space_1/.env.local @@ -0,0 +1,2 @@ +VITE_MY_TEST_VARIABLE=local +CUSTOM_MY_TEST_VARIABLE=custom \ No newline at end of file diff --git a/test/workspaces/space_1/test/env-injected.spec.ts b/test/workspaces/space_1/test/env-injected.spec.ts index 2235912a7966..9ac381fa72de 100644 --- a/test/workspaces/space_1/test/env-injected.spec.ts +++ b/test/workspaces/space_1/test/env-injected.spec.ts @@ -7,3 +7,19 @@ declare global { test('dev is injected', () => { expect(__DEV__).toBe(true) }) + +test('env variable is assigned', () => { + // we override it with "local" in .env.local, but dotenv prefers the root .env + // this is consistent with how Vite works + expect(import.meta.env.VITE_MY_TEST_VARIABLE).toBe('core') + expect(process.env.VITE_MY_TEST_VARIABLE).toBe('core') + expect(import.meta.env.CUSTOM_MY_TEST_VARIABLE).toBe('custom') + expect(process.env.CUSTOM_MY_TEST_VARIABLE).toBe('custom') + + expect(process.env.VITE_CORE_VARIABLE).toBe('core') + expect(process.env.CUSTOM_ROOT).toBe('custom') + expect(process.env.ROOT_VARIABLE).toBe('root') + expect(process.env.CONFIG_VAR).toBe('root') + expect(process.env.CONFIG_LOCAL).toBe('local') + expect(process.env.CONFIG_OVERRIDE).toBe('local') +}) diff --git a/test/workspaces/space_1/vite.config.ts b/test/workspaces/space_1/vite.config.ts index cd3b46cb1836..2423c17577bd 100644 --- a/test/workspaces/space_1/vite.config.ts +++ b/test/workspaces/space_1/vite.config.ts @@ -1,11 +1,16 @@ import { defineProject } from 'vitest/config' export default defineProject({ + envPrefix: ['VITE_', 'CUSTOM_'], define: { __DEV__: 'true', }, test: { name: 'space_1', environment: 'happy-dom', + env: { + CONFIG_LOCAL: 'local', + CONFIG_OVERRIDE: 'local', + }, }, }) diff --git a/test/workspaces/vitest.config.ts b/test/workspaces/vitest.config.ts index 7e7b028bf25d..5377d72a8ebf 100644 --- a/test/workspaces/vitest.config.ts +++ b/test/workspaces/vitest.config.ts @@ -7,6 +7,7 @@ if (process.env.TEST_WATCH) { } export default defineConfig({ + envPrefix: ['VITE_', 'CUSTOM_', 'ROOT_'], test: { coverage: { enabled: true, @@ -15,5 +16,9 @@ export default defineConfig({ reporters: ['default', 'json'], outputFile: './results.json', globalSetup: './globalTest.ts', + env: { + CONFIG_VAR: 'root', + CONFIG_OVERRIDE: 'root', + }, }, })