|
1 | 1 | import path from 'pathe' |
2 | 2 | import { expect, test } from 'vitest' |
| 3 | +import { rolldownVersion } from 'vitest/node' |
3 | 4 | import { buildTestProjectTree } from '../../test-utils' |
4 | 5 | import { instances, runBrowserTests, runInlineBrowserTests } from './utils' |
5 | 6 |
|
@@ -163,21 +164,40 @@ test('prints source-mapped stack for optimized dependency', async () => { |
163 | 164 |
|
164 | 165 | for (const [name, tree] of Object.entries(projectTree)) { |
165 | 166 | if (name === 'webkit') { |
166 | | - expect(tree).toMatchInlineSnapshot(` |
167 | | - { |
168 | | - "basic.test.ts": { |
169 | | - "fail": [ |
170 | | - { |
171 | | - "message": "this is test dependency error", |
172 | | - "stacks": [ |
173 | | - "throwDepError at ../../../../node_modules/.pnpm/<normalized>/node_modules/test-dep-error/index.js:2:18", |
174 | | - " at basic.test.ts:5:16", |
175 | | - ], |
176 | | - }, |
177 | | - ], |
178 | | - }, |
179 | | - } |
180 | | - `) |
| 167 | + if (rolldownVersion) { |
| 168 | + expect(tree).toMatchInlineSnapshot(` |
| 169 | + { |
| 170 | + "basic.test.ts": { |
| 171 | + "fail": [ |
| 172 | + { |
| 173 | + "message": "this is test dependency error", |
| 174 | + "stacks": [ |
| 175 | + "throwDepError at ../../../../node_modules/.pnpm/<normalized>/node_modules/test-dep-error/index.js:2:18", |
| 176 | + " at basic.test.ts:5:2", |
| 177 | + ], |
| 178 | + }, |
| 179 | + ], |
| 180 | + }, |
| 181 | + } |
| 182 | + `) |
| 183 | + } |
| 184 | + else { |
| 185 | + expect(tree).toMatchInlineSnapshot(` |
| 186 | + { |
| 187 | + "basic.test.ts": { |
| 188 | + "fail": [ |
| 189 | + { |
| 190 | + "message": "this is test dependency error", |
| 191 | + "stacks": [ |
| 192 | + "throwDepError at ../../../../node_modules/.pnpm/<normalized>/node_modules/test-dep-error/index.js:2:18", |
| 193 | + " at basic.test.ts:5:16", |
| 194 | + ], |
| 195 | + }, |
| 196 | + ], |
| 197 | + }, |
| 198 | + } |
| 199 | + `) |
| 200 | + } |
181 | 201 | } |
182 | 202 | else { |
183 | 203 | expect(tree).toMatchInlineSnapshot(` |
|
0 commit comments