Skip to content

Commit c90496e

Browse files
committed
test: test ssrTransform deps
1 parent 3607409 commit c90496e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts

+26
Original file line numberDiff line numberDiff line change
@@ -1778,3 +1778,29 @@ test('combine mappings', async () => {
17781778
`)
17791779
}
17801780
})
1781+
1782+
test.skip('deps', async () => {
1783+
const result = await ssrTransformSimple(`\
1784+
import a from "a";
1785+
export { b } from "b";
1786+
export * from "c";
1787+
export * as d from "d";
1788+
import("e");
1789+
`)
1790+
expect({
1791+
deps: result?.deps,
1792+
dynamicDeps: result?.dynamicDeps,
1793+
}).toMatchInlineSnapshot(`
1794+
{
1795+
"deps": [
1796+
"a",
1797+
"b",
1798+
"c",
1799+
"d",
1800+
],
1801+
"dynamicDeps": [
1802+
"e",
1803+
],
1804+
}
1805+
`)
1806+
})

packages/vite/src/node/ssr/runtime/__tests__/server-source-maps.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ describe('module runner initialization', async () => {
6363
expect(serializeStack(server, methodErrorNew)).toBe(
6464
' at Module.throwError (<root>/fixtures/throws-error-method.ts:11:9)',
6565
)
66+
67+
// TODO: test stacktrace on first line
68+
// https://github.com/vitejs/vite/issues/19627
6669
})
6770

6871
it('deep stacktrace', async ({ runner, server }) => {

0 commit comments

Comments
 (0)