Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix "excluded dep in included dep" test #18999

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions playground/nested-deps/__tests__/nested-deps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ test('handle nested package', async () => {
expect(await page.textContent('.side-c')).toBe(c)
expect(await page.textContent('.d')).toBe('[email protected]')
expect(await page.textContent('.nested-d')).toBe('[email protected]')
// TODO: Review if the test is correct
// expect(await page.textContent('.nested-e')).toBe('1')
expect(await page.textContent('.nested-e')).toBe('1')

expect(await page.textContent('.absolute-f')).toBe('[email protected]')
expect(await page.textContent('.self-referencing')).toBe('true')
Expand Down
4 changes: 2 additions & 2 deletions playground/nested-deps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2>self referencing</h2>
import C from '@vitejs/test-package-c'
import { C as sideC } from '@vitejs/test-package-c/side'
import D, { nestedD } from '@vitejs/test-package-d'
// import { testExcluded } from '@vitejs/test-package-e'
import { testExcluded } from '@vitejs/test-package-e'
import F from '__F_ABSOLUTE_PACKAGE_PATH__'
import { isSelfReference } from '@vitejs/self-referencing/test'

Expand All @@ -47,7 +47,7 @@ <h2>self referencing</h2>
text('.d', D)
text('.nested-d', nestedD)

// text('.nested-e', testExcluded())
text('.nested-e', testExcluded())

text('.absolute-f', F)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testExcluded } from 'test-package-e-excluded'
import { testExcluded } from '@vitejs/test-package-e-excluded'

Copy link
Member Author

@sapphi-red sapphi-red Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing this import, we can add test-package-e-excluded to optimizeDeps.exclude, too.

export function testIncluded() {
return testExcluded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"type": "module",
"main": "index.js",
"dependencies": {
"test-package-e-excluded": "link:../test-package-e-excluded"
"@vitejs/test-package-e-excluded": "link:../test-package-e-excluded"
}
}
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading