Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b007dbc
feat: support rolldown-vite
sheremet-va Feb 17, 2025
b1c2886
chore: undo versioning
sheremet-va Feb 17, 2025
c6805d5
chore: break @vue/ aliasing
sheremet-va Feb 17, 2025
2589405
fix: enable headless in a fixture by default
sheremet-va Feb 17, 2025
87aba50
chore: fix cache dir in mocker
sheremet-va Feb 17, 2025
9267876
test: avoid watch mode trigger for generated tests
sheremet-va Feb 17, 2025
3b86125
chore: cleanup
sheremet-va Feb 17, 2025
67c1afd
chore: add FIXME
sheremet-va Feb 17, 2025
1da1d6b
fix: patch test-utils correctly
sheremet-va Feb 19, 2025
c31db32
chore: use pkg.pr.new
sheremet-va Feb 19, 2025
845d8a4
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rolldow…
sheremet-va Feb 19, 2025
00e608a
chore: regenerate lockfile
sheremet-va Feb 19, 2025
5367a32
wip: fix build
hi-ogawa Feb 20, 2025
41cc1d8
chore: lint
hi-ogawa Feb 20, 2025
0dc2e38
fix: remove `stack.column + 1` esbuild sourcemap workaround
hi-ogawa Feb 21, 2025
e8900cf
test: skip global setup source map
hi-ogawa Feb 21, 2025
33a0935
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rolldow…
sheremet-va Feb 21, 2025
8b3008f
chore: fix type errors
sheremet-va Feb 21, 2025
3072d9b
chore: skip lit tests for now
sheremet-va Feb 21, 2025
5dd272f
chore: cleanup
sheremet-va Feb 21, 2025
8c5b648
chore: cleanup
sheremet-va Feb 21, 2025
54e0d98
chore: lint
sheremet-va Feb 24, 2025
9dfaf4e
Merge branch 'main' into feat/rolldown-support
hi-ogawa Mar 10, 2025
abf8692
chore: no need root rolldown workaround after isolated decl
hi-ogawa Mar 10, 2025
d687de3
test: fixup vite oxc warning
hi-ogawa Mar 10, 2025
d49c3ba
chore: latest rolldown-vite
hi-ogawa Mar 10, 2025
02fc9fd
chore: fix blog.data.ts export
hi-ogawa Mar 10, 2025
a4e5396
chore: cleaner blog.data.ts
hi-ogawa Mar 10, 2025
2ebee52
Merge branch 'main' into feat/rolldown-support
hi-ogawa Mar 12, 2025
4d1208b
chore(deps): vite
hi-ogawa Mar 12, 2025
7c67a7f
chore(deps): vite
hi-ogawa Mar 12, 2025
1340e84
chore: cleanup
sheremet-va Apr 17, 2025
431fd72
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rolldow…
sheremet-va May 30, 2025
25041d6
chore: workspaces-browser
sheremet-va May 30, 2025
1fac446
chore: lockfile
sheremet-va May 30, 2025
cda34aa
chore; update vite dependency
sheremet-va May 30, 2025
d604d31
chore: export rolldownVersion
sheremet-va May 30, 2025
45aff54
chore: fix typecheck
sheremet-va May 30, 2025
2fe2e51
chore: update exports
sheremet-va May 30, 2025
1eee71c
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rolldow…
sheremet-va Jun 3, 2025
e270b81
chore: cleanup
sheremet-va Jun 3, 2025
a198d7f
chore: cleanup
sheremet-va Jun 3, 2025
8b08751
test: have separate tests for rolldown source maps
sheremet-va Jun 3, 2025
6e97c1a
chore: disable esnext for now
sheremet-va Jun 3, 2025
43da06b
chore: update v8 coverage
sheremet-va Jun 3, 2025
7f1d4cb
chore: undo delete
sheremet-va Jun 3, 2025
f61806a
Merge branch 'main' of github.com:vitest-dev/vitest into feat/rolldow…
sheremet-va Jun 3, 2025
5558ffe
fix: use vite instead of rolldown-vite
sheremet-va Jun 3, 2025
3fee8d9
test: check if rolldown
sheremet-va Jun 3, 2025
b14aedd
test: update exports test
sheremet-va Jun 3, 2025
a8df621
test: exclude esnext.test.ts only on rolldown
hi-ogawa Jun 3, 2025
4a429dc
chore: remove unneeded overrides
hi-ogawa Jun 4, 2025
ccd9d5b
Merge branch 'main' into feat/rolldown-support
hi-ogawa Jun 4, 2025
855ac9f
chore: back to vite
hi-ogawa Jun 4, 2025
5fcae89
chore: pnpm dedupe
hi-ogawa Jun 4, 2025
a39fb5c
ci: add rolldown-vite pipeline
sheremet-va Jun 4, 2025
4f3130e
chore: fix config
sheremet-va Jun 4, 2025
8986e04
chore: install in CI anyway
sheremet-va Jun 4, 2025
510ca94
chore: hmmmm
sheremet-va Jun 4, 2025
4e7456c
chore: isntall all pw browsers
sheremet-va Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,39 @@ jobs:

- name: Test Browser (webdriverio)
run: pnpm run test:browser:webdriverio

test-rolldown:
needs: changed
# macos-latest is the fastes one
name: 'Rolldown&Test: node-20, macos-latest'
if: needs.changed.outputs.should_skip != 'true'
runs-on: macos-latest

timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-and-cache
with:
node-version: 20

- uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce # v1.7.3

- name: Install
run: pnpm add vite@npm:rolldown-vite && git add . && git commit -m "ci" && pnpm i --prefer-offline --no-frozen-lockfile

- name: Install Playwright Dependencies
run: pnpm exec playwright install --with-deps --only-shell

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test:ci

- name: Test Examples
run: pnpm run test:examples

- name: Test Browser (playwright)
run: pnpm run test:browser:playwright
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "pnpm -r --filter @vitest/ui --filter='./packages/**' run build",
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" pnpm -r --parallel --filter='./packages/**' run dev",
"docs": "pnpm -C docs run dev",
"docs:build": "pnpm -C docs run build",
"docs:build": "ROLLDOWN_OPTIONS_VALIDATION=loose pnpm -C docs run build",
"docs:serve": "pnpm -C docs run serve",
"docs:https": "pnpm -C docs run preview-https",
"docs:https-no-prefetch": "pnpm -C docs run preview-https-no-prefetch",
Expand Down Expand Up @@ -96,6 +96,7 @@
"esbuild",
"geckodriver",
"msw",
"rolldown",
"sharp",
"svelte-preprocess",
"vue-demi"
Expand Down
17 changes: 6 additions & 11 deletions packages/runner/src/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function createSuiteCollector(

if (runner.config.includeTaskLocation) {
const error = stackTraceError.stack!
const stack = findTestFileStackTrace(error, task.each ?? false)
const stack = findTestFileStackTrace(error)
if (stack) {
task.location = stack
}
Expand Down Expand Up @@ -460,7 +460,7 @@ function createSuiteCollector(
Error.stackTraceLimit = 15
const error = new Error('stacktrace').stack!
Error.stackTraceLimit = limit
const stack = findTestFileStackTrace(error, suite.each ?? false)
const stack = findTestFileStackTrace(error)
if (stack) {
suite.location = stack
}
Expand Down Expand Up @@ -890,21 +890,16 @@ function formatTemplateString(cases: any[], args: any[]): any[] {
return res
}

function findTestFileStackTrace(error: string, each: boolean) {
function findTestFileStackTrace(error: string) {
const testFilePath = getTestFilepath()
// first line is the error message
const lines = error.split('\n').slice(1)
for (const line of lines) {
const stack = parseSingleStack(line)
if (stack && stack.file === getTestFilepath()) {
if (stack && stack.file === testFilePath) {
return {
line: stack.line,
/**
* test.each([1, 2])('name')
* ^ leads here, but should
* ^ lead here
* in source maps it's the same boundary, so it just points to the start of it
*/
column: each ? stack.column + 1 : stack.column,
column: stack.column,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/plugins/normalizeURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function NormalizeURLPlugin(): Plugin {
const assetImportMetaUrlRE
// vite injects new URL(path, import.meta.url) in the code
// rolldown-vite injects new URL(path, '' + import.meta.url) in the code
= /\bnew\s+URL\s*\(\s*(?:'[^']+'|"[^"]+"|`[^`]+`)\s*,\s*(?:'' \+ )?import\.meta\.url\s*(?:,\s*)?\)/g
= /\bnew\s+URL\s*\(\s*(?:'[^']+'|"[^"]+"|`[^`]+`)\s*,\s*(?:'' \+ )?import\.meta\.url\s*(?:,\s*)?\)/g

let updatedCode = code
let match: RegExpExecArray | null
Expand Down
9 changes: 6 additions & 3 deletions packages/vitest/src/public/node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ModuleDiagnostic as _FileDiagnostic } from '../node/reporters/reported-tasks'
import { createServer as _createServer } from 'vite'
import * as vite from 'vite'
import { Vitest } from '../node/core'
import { TestModule as _TestFile } from '../node/reporters/reported-tasks'

Expand Down Expand Up @@ -81,8 +81,8 @@ export type {
ResolvedBrowserOptions,
} from '../node/types/browser'
/** @deprecated use `createViteServer` instead */
export const createServer: typeof _createServer = _createServer
export const createViteServer: typeof _createServer = _createServer
export const createServer: typeof vite.createServer = vite.createServer
export const createViteServer: typeof vite.createServer = vite.createServer
export type {
ApiConfig,
BuiltinEnvironment,
Expand Down Expand Up @@ -175,4 +175,7 @@ export {
version as viteVersion,
} from 'vite'

// rolldownVersion is exported only by rolldown-vite
export const rolldownVersion: string | undefined = (vite as any).rolldownVersion

export type * as Vite from 'vite'
Loading